Package

com.lightbend.lagom.javadsl

testkit

Permalink

package testkit

Visibility
  1. Public
  2. All

Type Members

  1. class PersistentEntityTestDriver[C, E, S] extends AnyRef

    Permalink

    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 issues of the Outcome.

Value Members

  1. object PersistentEntityTestDriver

    Permalink
  2. object ServiceTest

    Permalink

    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 by default running with persistence, pubsub and cluster features enabled. Cassandra is also started before the test server is started. If your service does not use these features you can disable them in the Setup, which will reduce the startup time.

    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.

Ungrouped