Skip to content
This repository has been archived by the owner on May 22, 2018. It is now read-only.

Commit

Permalink
Publish lagom 1.4 modules
Browse files Browse the repository at this point in the history
- Fix broken unit test for the `lagom14ScalaServiceLocatorDns` module.
- Use `LagomApplication` in the tests belonging to `lagom14ScalaServiceLocatorDns` and `lagom14ScalaServiceLocatorDns` modules.
  • Loading branch information
fsat committed Sep 22, 2017
1 parent 1c94b41 commit b639f86
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 6 deletions.
10 changes: 8 additions & 2 deletions build.sbt
@@ -1,6 +1,12 @@
lazy val root = project
.in(file("."))
.aggregate(serviceLocatorDns, lagom13JavaServiceLocatorDns, lagom13ScalaServiceLocatorDns)
.aggregate(
serviceLocatorDns,
lagom13JavaServiceLocatorDns,
lagom13ScalaServiceLocatorDns,
lagom14JavaServiceLocatorDns,
lagom14ScalaServiceLocatorDns
)

lazy val serviceLocatorDns = project
.in(file("service-locator-dns"))
Expand All @@ -27,4 +33,4 @@ lazy val lagom14ScalaServiceLocatorDns = project
.enablePlugins(AutomateHeaderPlugin)

name := "root"
publishArtifact := false
publishArtifact := false
1 change: 1 addition & 0 deletions lagom13-scala-service-locator-dns/build.sbt
Expand Up @@ -3,6 +3,7 @@ name := "lagom13-scala-service-locator-dns"
libraryDependencies ++= Seq(
Library.lagom13ScalaClient,
Library.akkaTestkit % "test",
Library.lagom13ScalaServer % "test",
Library.scalaTest % "test"
)

Expand Down
Expand Up @@ -17,18 +17,31 @@ import org.scalatest._
import com.lightbend.dns.locator.{ ServiceLocator => ServiceLocatorService }
import com.lightbend.lagom.internal.client.{ CircuitBreakerConfig, CircuitBreakerMetricsProviderImpl, CircuitBreakers }
import com.lightbend.lagom.internal.spi.CircuitBreakerMetricsProvider
import play.api.{ ApplicationLoader, BuiltInComponentsFromContext, Environment }
import com.lightbend.lagom.scaladsl.api.Service.named
import com.lightbend.lagom.scaladsl.api.{ Descriptor, Service }
import com.lightbend.lagom.scaladsl.dns
import com.lightbend.lagom.scaladsl.server.{ LagomApplication, LagomApplicationContext }
import play.api.libs.ws.ahc.AhcWSComponents
import play.api.routing.Router

import scala.concurrent.ExecutionContext

object DnsServiceLocatorSpec {
class DummyService extends Service {
override def descriptor: Descriptor = {
import Service._
named("dummy")
}
}
}

class DnsServiceLocatorSpec extends WordSpec with Matchers with BeforeAndAfterAll with ScalaFutures {

implicit val system: ActorSystem = ActorSystem("ServiceLocatorSpec", ConfigFactory.load())
implicit val mat: Materializer = ActorMaterializer.create(system)

val app = new BuiltInComponentsFromContext(ApplicationLoader.createContext(Environment.simple())) with AhcWSComponents with DnsServiceLocatorComponents {
val app = new LagomApplication(LagomApplicationContext.Test) with AhcWSComponents with DnsServiceLocatorComponents {
override lazy val lagomServer = serverFor[DnsServiceLocatorSpec.DummyService](new dns.DnsServiceLocatorSpec.DummyService())
override lazy val actorSystem: ActorSystem = system
override lazy val materializer: Materializer = mat
override lazy val executionContext: ExecutionContext = actorSystem.dispatcher
Expand Down
1 change: 1 addition & 0 deletions lagom14-scala-service-locator-dns/build.sbt
Expand Up @@ -3,6 +3,7 @@ name := "lagom14-scala-service-locator-dns"
libraryDependencies ++= Seq(
Library.lagom14ScalaClient,
Library.akkaTestkit % "test",
Library.lagom14ScalaServer % "test",
Library.scalaTest % "test"
)

Expand Down
Expand Up @@ -17,18 +17,29 @@ import org.scalatest._
import com.lightbend.dns.locator.{ ServiceLocator => ServiceLocatorService }
import com.lightbend.lagom.internal.client.{ CircuitBreakerConfig, CircuitBreakerMetricsProviderImpl, CircuitBreakers }
import com.lightbend.lagom.internal.spi.CircuitBreakerMetricsProvider
import play.api.{ ApplicationLoader, BuiltInComponentsFromContext, Environment }
import com.lightbend.lagom.scaladsl.api.{ Descriptor, Service }
import com.lightbend.lagom.scaladsl.server.{ LagomApplication, LagomApplicationContext }
import play.api.libs.ws.ahc.AhcWSComponents
import play.api.routing.Router

import scala.concurrent.ExecutionContext

object DnsServiceLocatorSpec {
class DummyService extends Service {
override def descriptor: Descriptor = {
import Service._
named("dummy")
}
}
}

class DnsServiceLocatorSpec extends WordSpec with Matchers with BeforeAndAfterAll with ScalaFutures {

implicit val system: ActorSystem = ActorSystem("ServiceLocatorSpec", ConfigFactory.load())
implicit val mat: Materializer = ActorMaterializer.create(system)

val app = new BuiltInComponentsFromContext(ApplicationLoader.createContext(Environment.simple())) with AhcWSComponents with DnsServiceLocatorComponents {
val app = new LagomApplication(LagomApplicationContext.Test) with AhcWSComponents with DnsServiceLocatorComponents {
override lazy val lagomServer = serverFor[DnsServiceLocatorSpec.DummyService](new DnsServiceLocatorSpec.DummyService())
override lazy val actorSystem: ActorSystem = system
override lazy val materializer: Materializer = mat
override lazy val executionContext: ExecutionContext = actorSystem.dispatcher
Expand Down
2 changes: 2 additions & 0 deletions project/Dependencies.scala
Expand Up @@ -23,7 +23,9 @@ object Library {
val lagom13JavaClient = "com.lightbend.lagom" %% "lagom-javadsl-client" % Version.lagom13
val lagom14JavaClient = "com.lightbend.lagom" %% "lagom-javadsl-client" % Version.lagom14
val lagom13ScalaClient = "com.lightbend.lagom" %% "lagom-scaladsl-client" % Version.lagom13
val lagom13ScalaServer = "com.lightbend.lagom" %% "lagom-scaladsl-server" % Version.lagom13
val lagom14ScalaClient = "com.lightbend.lagom" %% "lagom-scaladsl-client" % Version.lagom14
val lagom14ScalaServer = "com.lightbend.lagom" %% "lagom-scaladsl-server" % Version.lagom14
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
}

Expand Down

0 comments on commit b639f86

Please sign in to comment.