A testing utility for verifying that a com.lightbend.lagom.javadsl.persistence.PersistentEntity emits expected events and side-effects in response to incoming commands.
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.
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.
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 GuiceApplicationBuilder
in the Setup
.
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 @BeforeClass
and stop it in a method annotated with @AfterClass
.
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
issues
of theOutcome
.