Skip to content

Commit c7c636a

Browse files
authored
Merge pull request #62 from moia-oss/typed
#56: Use Akka Typed
2 parents 8ddd6be + cee2501 commit c7c636a

File tree

5 files changed

+38
-22
lines changed

5 files changed

+38
-22
lines changed

build.sbt

+13-13
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@ lazy val library =
6767
val scalaLogging = "3.9.4"
6868
val scalaTest = "3.2.11"
6969
}
70-
val akkaActor = "com.typesafe.akka" %% "akka-actor" % Version.akka
71-
val akkaHttp = "com.typesafe.akka" %% "akka-http" % Version.akkaHttp
72-
val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % Version.akkaHttp
73-
val akkaStream = "com.typesafe.akka" %% "akka-stream" % Version.akka
74-
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % Version.akka
75-
val log4jApi = "org.apache.logging.log4j" % "log4j-api" % Version.log4j
76-
val log4jCore = "org.apache.logging.log4j" % "log4j-core" % Version.log4j
77-
val logJulOverLog4j = "org.apache.logging.log4j" % "log4j-jul" % Version.log4j
78-
val logSlfOverLog4j = "org.apache.logging.log4j" % "log4j-slf4j-impl" % Version.log4j
79-
val pureConfig = "com.github.pureconfig" %% "pureconfig" % Version.pureConfig
80-
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
81-
val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % Version.scalaLogging
82-
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
70+
val akkaActor = "com.typesafe.akka" %% "akka-actor-typed" % Version.akka
71+
val akkaHttp = "com.typesafe.akka" %% "akka-http" % Version.akkaHttp
72+
val akkaHttpTestkit = "com.typesafe.akka" %% "akka-http-testkit" % Version.akkaHttp
73+
val akkaStream = "com.typesafe.akka" %% "akka-stream-typed" % Version.akka
74+
val akkaTestkit = "com.typesafe.akka" %% "akka-actor-testkit-typed" % Version.akka
75+
val log4jApi = "org.apache.logging.log4j" % "log4j-api" % Version.log4j
76+
val log4jCore = "org.apache.logging.log4j" % "log4j-core" % Version.log4j
77+
val logJulOverLog4j = "org.apache.logging.log4j" % "log4j-jul" % Version.log4j
78+
val logSlfOverLog4j = "org.apache.logging.log4j" % "log4j-slf4j-impl" % Version.log4j
79+
val pureConfig = "com.github.pureconfig" %% "pureconfig" % Version.pureConfig
80+
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
81+
val scalaLogging = "com.typesafe.scala-logging" %% "scala-logging" % Version.scalaLogging
82+
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
8383
}
8484

8585
// *****************************************************************************

samples/src/main/scala/io/moia/itkit/samples/Main.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.moia.itkit.samples
22

3-
import akka.actor.ActorSystem
3+
import akka.actor.typed.ActorSystem
4+
import akka.actor.typed.scaladsl.Behaviors
45
import akka.http.scaladsl.Http
56
import akka.http.scaladsl.settings.ServerSettings
67
import io.moia.itkit.Logger
@@ -9,8 +10,8 @@ import scala.util.{Failure, Success}
910

1011
object Main extends Logger {
1112
def main(args: Array[String]): Unit = {
12-
implicit val system: ActorSystem = ActorSystem()
13-
import system.dispatcher
13+
implicit val system: ActorSystem[Nothing] = ActorSystem(Behaviors.empty, "itkit")
14+
import system.executionContext
1415

1516
type OptionMap = Map[Symbol, String]
1617

src/main/scala/io/moia/itkit/OneClientPerSuite.scala

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
package io.moia.itkit
66

7-
import akka.actor.ActorSystem
7+
import akka.actor.typed.ActorSystem
8+
import akka.actor.typed.scaladsl.Behaviors
89
import akka.http.scaladsl.model.Uri
910
import akka.http.scaladsl.{Http, HttpExt}
1011
import akka.stream.Materializer
@@ -18,7 +19,11 @@ trait OneClientPerSuite extends AsyncTestSuiteMixin with ClientProvider { this:
1819
}
1920
""")
2021

21-
implicit private val system: ActorSystem = ActorSystem(s"itkit-client-${suiteId.hashCode().toString}", ConfigFactory.load(clientConfig))
22+
implicit private val system: ActorSystem[Nothing] = ActorSystem(
23+
guardianBehavior = Behaviors.empty,
24+
name = s"itkit-client-${suiteId.hashCode().toString}",
25+
config = ConfigFactory.load(clientConfig)
26+
)
2227

2328
implicit protected val actorMaterializer: Materializer = implicitly[Materializer]
2429

src/main/scala/io/moia/itkit/OneServerPerTest.scala

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
package io.moia
66
package itkit
77

8-
import akka.actor.ActorSystem
8+
import akka.actor.typed.ActorSystem
9+
import akka.actor.typed.scaladsl.Behaviors
910
import akka.http.scaladsl.model.Uri
1011
import akka.http.scaladsl.{Http, HttpExt}
1112
import akka.stream.Materializer
@@ -24,7 +25,11 @@ trait OneServerPerTest extends AsyncTestSuiteMixin { this: AsyncTestSuite =>
2425
}
2526
""")
2627

27-
implicit private val system: ActorSystem = ActorSystem(s"itkit-client-${suiteId.hashCode().toString}", ConfigFactory.load(clientConfig))
28+
implicit private val system: ActorSystem[Nothing] = ActorSystem(
29+
guardianBehavior = Behaviors.empty,
30+
name = s"itkit-client-${suiteId.hashCode().toString}",
31+
config = ConfigFactory.load(clientConfig)
32+
)
2833
implicit protected val materializer: Materializer = implicitly[Materializer]
2934

3035
private lazy val suiteHttp: HttpExt = Http()

src/main/scala/io/moia/itkit/fixture/OneServerPerTestWithClient.scala

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
package io.moia.itkit.fixture
66

7-
import akka.actor.ActorSystem
7+
import akka.actor.typed.ActorSystem
8+
import akka.actor.typed.scaladsl.Behaviors
89
import akka.http.scaladsl.model.Uri
910
import akka.http.scaladsl.{Http, HttpExt}
1011
import akka.stream.Materializer
@@ -22,7 +23,11 @@ trait OneServerPerTestWithClient extends AsyncTestSuiteMixin with ProcessProvide
2223
}
2324
""")
2425

25-
implicit private val system: ActorSystem = ActorSystem(s"itkit-client-${suiteId.hashCode().toString}", ConfigFactory.load(clientConfig))
26+
implicit private val system: ActorSystem[Nothing] = ActorSystem(
27+
guardianBehavior = Behaviors.empty,
28+
name = s"itkit-client-${suiteId.hashCode().toString}",
29+
config = ConfigFactory.load(clientConfig)
30+
)
2631

2732
implicit protected val actorMaterializer: Materializer = implicitly[Materializer]
2833

0 commit comments

Comments
 (0)