Packages

final class ProjectionTestKit extends AnyRef

Source
ProjectionTestKit.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ProjectionTestKit
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def run(projection: Projection[_], max: FiniteDuration, interval: FiniteDuration)(assertFunction: => Unit): Unit

    Run a Projection and assert its projected data using the passed assert function, the max duration of the test and the interval between each assertion.

    Run a Projection and assert its projected data using the passed assert function, the max duration of the test and the interval between each assertion.

    Projection is started and stopped by the TestKit. While the projection is running, the assert function will be called every interval until it completes without errors (no exceptions or assertion errors are thrown).

    If the assert function doesn't complete without error within the passed max duration the test will fail.

    Note: when testing a Projection with this method, the Restart Backoff is disabled. Any backoff configuration settings from .conf file or programmatically added will be overwritten.

    projection

    - the Projection to run

    max

    - FiniteDuration delimiting the max duration of the test

    interval

    - FiniteDuration defining the interval in each the assert function will be called

    assertFunction

    - a by-name code block that exercise the test assertions

  2. def run(projection: Projection[_], max: FiniteDuration)(assertFunction: => Unit): Unit

    Run a Projection and assert its projected data using the passed assert function and the max duration of the test.

    Run a Projection and assert its projected data using the passed assert function and the max duration of the test.

    Projection is started and stopped by the TestKit. While the projection is running, the assert function will be called every 100 milliseconds until it completes without errors (no exceptions or assertion errors are thrown).

    If the assert function doesn't complete without error within the passed max duration the test will fail.

    Note: when testing a Projection with this method, the Restart Backoff is disabled. Any backoff configuration settings from .conf file or programmatically added will be overwritten.

    projection

    - the Projection to run

    max

    - FiniteDuration delimiting the max duration of the test

    assertFunction

    - a by-name code block that exercise the test assertions

  3. def run(projection: Projection[_])(assertFunction: => Unit): Unit

    Run a Projection and assert its projected data using the passed assert function.

    Run a Projection and assert its projected data using the passed assert function.

    Projection is started and stopped by the TestKit. While the projection is running, the assert function will be called every 100 milliseconds until it completes without errors (no exceptions or assertion errors are thrown).

    If the assert function doesn't complete without error within the configuration provided to akka.actor.testkit.typed.single-expect-default (3 seconds by default with no dilation) then the test will fail.

    Note: when testing a Projection with this method, the Restart Backoff is disabled. Any backoff configuration settings from .conf file or programmatically added will be overwritten.

    projection

    - the Projection to run

    assertFunction

    - a by-name code block that exercise the test assertions

  4. def runWithTestSink(projection: Projection[_])(assertFunction: (Probe[Done]) => Unit): Unit

    Run a Projection with an attached TestSubscriber.Probe allowing control over the pace in which the elements flow through the Projection.

    Run a Projection with an attached TestSubscriber.Probe allowing control over the pace in which the elements flow through the Projection.

    The assertion function receives a TestSubscriber.Probe that you can use to request elements.

    The Projection starts as soon as the first element is requested by the TestSubscriber.Probe, new elements will be emitted as requested. The Projection is stopped once the assert function completes.

    projection

    - the Projection to run

    assertFunction

    - a function receiving a TestSubscriber.Probe[Done]