Skip to content

evolution-gaming/akka-test

Repository files navigation

akka-test

travis-ci github-actions scoverage codacy bintray license: MIT

This library is created in order to provide reusable set of tests to be used in projects dependent on Akka libraries. For instance to prevent following "surprise" at runtime:

java.lang.IllegalStateException: Detected possible incompatible versions on the classpath. Please note that a given Akka HTTP version MUST be the same across all modules of Akka HTTP that you are using, e.g. if you use [10.1.11] all other modules that are released together MUST be of the same version. Make sure you're using a compatible set of libraries. Possibly conflicting versions [10.1.9, 10.1.11] in libraries [akka-http-spray-json:10.1.9, akka-parsing:10.1.11, akka-http-xml:10.1.11, akka-http:10.1.11, akka-http-core:10.1.11]
	at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:206)
	at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:173)
	at akka.http.scaladsl.HttpExt.<init>(Http.scala:75)
	at akka.http.scaladsl.Http$.createExtension(Http.scala:1123)
	at akka.http.scaladsl.Http$.createExtension(Http.scala:892)
	at akka.actor.ActorSystemImpl.registerExtension(ActorSystem.scala:1151)
	at akka.actor.ExtensionId.apply(Extension.scala:78)
	at akka.actor.ExtensionId.apply$(Extension.scala:77)
	at akka.http.scaladsl.Http$.apply(Http.scala:1118)

Tests:

  • akka modules are of same version

Usage

resolvers += Resolver.bintrayRepo("evolutiongaming", "maven")

libraryDependencies += "com.evolutiongaming" %% "akka-test-actor" % "0.0.2" % Test

And just drop this test into your project

import com.evolutiongaming.akkatest.AkkaActorSuite

class AkkaActorTest extends AkkaActorSuite

Tests:

  • akka-http modules are of same version

Usage

Add dependency

resolvers += Resolver.bintrayRepo("evolutiongaming", "maven")

libraryDependencies += "com.evolutiongaming" %% "akka-test-http" % "0.0.2" % Test

And just drop this test into your project

import com.evolutiongaming.akkatest.AkkaHttpSuite

class AkkaHttpTest extends AkkaHttpSuite

Setup

resolvers += Resolver.bintrayRepo("evolutiongaming", "maven")

libraryDependencies += "com.evolutiongaming" %% "akka-test-actor" % "0.0.2"

libraryDependencies += "com.evolutiongaming" %% "akka-test-http" % "0.0.2"