Commit 1ffabb90 authored by Andreas Muttscheller's avatar Andreas Muttscheller

Minor code refactor

parent ea04b1e5
......@@ -38,5 +38,9 @@ lazy val root = (project in file("."))
// GraphQL
"org.sangria-graphql" %% "sangria" % "1.4.2",
"org.sangria-graphql" %% "sangria-json4s-native" % "1.0.0",
// Gatling
"io.gatling.highcharts" % "gatling-charts-highcharts" % "3.0.3" % "test",
"io.gatling" % "gatling-test-framework" % "3.0.3" % "test",
)
)
\ No newline at end of file
package de.codecentric.amuttsch.bahndelayinfo.aws
import com.amazonaws.services.lambda.runtime.{ClientContext, CognitoIdentity, Context, LambdaLogger}
class DummyContext extends Context {
override def getAwsRequestId: String = "DummyContext"
override def getLogGroupName: String = "getLogGroupName"
override def getLogStreamName: String = "getLogStreamName"
override def getFunctionName: String = "getFunctionName"
override def getFunctionVersion: String = "getFunctionVersion"
override def getInvokedFunctionArn: String = "getInvokedFunctionArn"
override def getIdentity: CognitoIdentity = null
override def getClientContext: ClientContext = null
override def getRemainingTimeInMillis: Int = Int.MaxValue
override def getMemoryLimitInMB: Int = 128
override def getLogger: LambdaLogger = null
}
......@@ -9,13 +9,13 @@ import com.amazonaws.services.lambda.runtime.events.SNSEvent
import com.typesafe.config.{Config, ConfigFactory}
import com.typesafe.scalalogging.Logger
import de.codecentric.amuttsch.bahndelayinfo.aws.sns.SNSNewDelayInformation
import de.codecentric.amuttsch.bahndelayinfo.fetcher.TimetableInformation
import de.codecentric.amuttsch.bahndelayinfo.models.TimetableInformation
import de.codecentric.amuttsch.bahndelayinfo.slackbot.{SlackClient, SlackUser}
import de.codecentric.amuttsch.bahndelayinfo.utils.JsonSerializers
import de.codecentric.amuttsch.bahndelayinfo.utils.TraversableImplicits._
import org.json4s._
import org.json4s.native.JsonMethods._
import org.json4s.native.Serialization.write
import de.codecentric.amuttsch.bahndelayinfo.utils.TraversableImplicits._
import scala.util.{Success, Try}
......
......@@ -7,8 +7,8 @@ import com.amazonaws.services.lambda.runtime.events.ScheduledEvent
import com.amazonaws.services.sns.AmazonSNSClientBuilder
import com.typesafe.scalalogging.Logger
import de.codecentric.amuttsch.bahndelayinfo.aws.sns.SNSNewDelayInformation
import de.codecentric.amuttsch.bahndelayinfo.fetcher.{DBChangedTimetableFetcher, TimetableInformation}
import de.codecentric.amuttsch.bahndelayinfo.models.PlannedTimetableElement
import de.codecentric.amuttsch.bahndelayinfo.fetcher.DBChangedTimetableFetcher
import de.codecentric.amuttsch.bahndelayinfo.models.{PlannedTimetableElement, TimetableInformation}
import org.json4s._
import org.json4s.native.JsonMethods._
import org.json4s.native.Serialization.write
......
......@@ -2,6 +2,7 @@ package de.codecentric.amuttsch.bahndelayinfo.fetcher
import com.softwaremill.sttp._
import com.typesafe.config.Config
import de.codecentric.amuttsch.bahndelayinfo.models.TimetableInformation
class DBChangedTimetableFetcher extends DBFetcher {
......
......@@ -3,6 +3,7 @@ package de.codecentric.amuttsch.bahndelayinfo.fetcher
import com.softwaremill.sttp._
import com.typesafe.config.{Config, ConfigFactory}
import com.typesafe.scalalogging.Logger
import de.codecentric.amuttsch.bahndelayinfo.models.TimetableInformation
import org.xml.sax.SAXParseException
import scala.xml.XML
......
......@@ -5,6 +5,7 @@ import java.util.Calendar
import com.softwaremill.sttp._
import com.typesafe.config.Config
import de.codecentric.amuttsch.bahndelayinfo.models.TimetableInformation
class DBPlannedTimetableFetcher extends DBFetcher {
......
package de.codecentric.amuttsch.bahndelayinfo.fetcher
package de.codecentric.amuttsch.bahndelayinfo.models
import java.time.format.DateTimeFormatter
import java.time.{LocalDateTime, ZoneId}
......
......@@ -14,8 +14,7 @@ import com.sksamuel.elastic4s.searches.queries.BoolQuery
import com.sksamuel.elastic4s.searches.queries.matches.MatchQuery
import com.softwaremill.sttp._
import de.codecentric.amuttsch.bahndelayinfo.aws
import de.codecentric.amuttsch.bahndelayinfo.fetcher.TimetableInformation
import de.codecentric.amuttsch.bahndelayinfo.models.Station
import de.codecentric.amuttsch.bahndelayinfo.models.{Station, TimetableInformation}
import de.codecentric.amuttsch.bahndelayinfo.utils.JsonSerializers
import org.json4s.native.JsonMethods.parse
import org.json4s.native.Serialization.write
......
......@@ -2,7 +2,7 @@ package de.codecentric.amuttsch.bahndelayinfo.slackbot
import java.time.LocalTime
import de.codecentric.amuttsch.bahndelayinfo.fetcher.TimetableInformation
import de.codecentric.amuttsch.bahndelayinfo.models.TimetableInformation
import scala.collection.mutable
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment