Created
January 2, 2018 14:10
-
-
Save erip/7439e8c6ef853eda69487915986e9a14 to your computer and use it in GitHub Desktop.
`withClient` example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.lightbend.lagom.scaladsl.testkit.ServiceTest._ | |
private def withDefaultClient(testCode: (MyService) => Any): Unit = { | |
withServer(ServiceTest.defaultSetup) { ctx => | |
new MyApplication(ctx) with LocalServiceLocator { | |
// whatever your Application Cake should look like... | |
} | |
} { server => | |
// Client for your service | |
val client = server.serviceClient.implement[MyService] | |
testCode(client) | |
// Sleep so cassandra can drop keys and restart... | |
Thread.sleep(1000) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage