package testkit
- Alphabetic
- Public
- All
Type Members
-
class
PersistentEntityTestDriver[C, E, S] extends AnyRef
A testing utility for verifying that a com.lightbend.lagom.javadsl.persistence.PersistentEntity emits expected events and side-effects in response to incoming commands.
A testing utility for verifying that a com.lightbend.lagom.javadsl.persistence.PersistentEntity emits expected events and side-effects in response to incoming commands.
It also verifies that all commands, events, replies and state are serializable, and reports any such problems in the
issuesof theOutcome. -
final
class
ProducerStub[T] extends AnyRef
Stubs the production end of a com.lightbend.lagom.javadsl.api.broker.Topic so that test writers can mock message production from upstream services into topics consumed by services under test.
-
final
class
ProducerStubFactory extends AnyRef
Factors com.lightbend.lagom.javadsl.testkit.ProducerStub's.
Factors com.lightbend.lagom.javadsl.testkit.ProducerStub's. This is a singleton that should be javax.inject.Injected on the stubbed Services when writing tests.
- Annotations
- @Singleton()
-
class
ReadSideTestDriver extends ReadSide
- Annotations
- @Singleton()
Value Members
- object PersistentEntityTestDriver
-
object
ServiceTest
Support for writing functional tests for one service.
Support for writing functional tests for one service. The service is running in a server and in the test you can interact with it using its service client, i.e. calls to the service API.
Dependencies to other services must be replaced by stub or mock implementations by overriding the bindings of the
GuiceApplicationBuilderin theSetup.The server is ran standalone without persistence, pubsub or cluster features enabled. Cassandra is also disabled by default. If your service require either of these features you can enable them in the
Setup.There are two different styles that can be used. It is most convenient to use withServer, since it automatically starts and stops the server before and after the given lambda. When your test have several test methods, and especially when using persistence, it is faster to only start the server once in a static method annotated with
@BeforeClassand stop it in a method annotated with@AfterClass.