Packages

  • package root
    Definition Classes
    root
  • package com
    Definition Classes
    root
  • package lightbend
    Definition Classes
    com
  • package lagom
    Definition Classes
    lightbend
  • package scaladsl
    Definition Classes
    lagom
  • package testkit
    Definition Classes
    scaladsl
  • 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.

    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 ServiceTest.withServer(), since it automatically starts and stops the server before and after the given block. When your test have several test methods, and especially when using persistence, it is faster to only ServiceTest.startServer() the server once in a before all tests hook, and then stop it in an after all test hook.

    Definition Classes
    testkit
  • Setup
  • TestServer

sealed trait Setup extends AnyRef

Source
ServiceTest.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Setup
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def cassandra: Boolean

    Whether Cassandra is enabled.

  2. abstract def cluster: Boolean

    Whether clustering is enabled.

  3. abstract def jdbc: Boolean

    Whether JDBC is enabled.

  4. abstract def ssl: Boolean

    Whether SSL is enabled.

  5. abstract def withCassandra(enabled: Boolean): Setup

    Enable or disable Cassandra.

    Enable or disable Cassandra.

    enabled

    True if Cassandra should be enabled, or false if disabled. Enabling Cassandra will also enable the cluster.

    returns

    A copy of this setup.

  6. abstract def withCluster(enabled: Boolean): Setup

    Enable or disable clustering.

    Enable or disable clustering.

    Disabling this will automatically disable any persistence plugins, since persistence requires clustering.

    enabled

    True if clustering should be enabled, or false if disabled.

    returns

    A copy of this setup.

  7. abstract def withJdbc(enabled: Boolean): Setup

    Enable or disable JDBC.

    Enable or disable JDBC.

    Enabling JDBC will also enable the cluster.

    enabled

    True if JDBC should be enabled, or false if disabled.

    returns

    A copy of this setup.

  8. abstract def withSsl(enabled: Boolean): Setup

    Enable or disable the SSL port.

    Enable or disable the SSL port.

    enabled

    True if the server should bind an HTTP+TLS port, or false if only HTTP should be bound.

    returns

    A copy of this setup.

    Annotations
    @ApiMayChange()

Concrete Value Members

  1. def withCassandra(): Setup

    Enable Cassandra.

    Enable Cassandra.

    If enabled, this will start an embedded Cassandra server before the tests start, and shut it down afterwards. It will also configure Lagom to use the embedded Cassandra server. Enabling Cassandra will also enable the cluster.

    returns

    A copy of this setup.

  2. def withCluster(): Setup

    Enable clustering.

    Enable clustering.

    Disabling this will automatically disable any persistence plugins, since persistence requires clustering.

    returns

    A copy of this setup.

  3. def withJdbc(): Setup

    Enable JDBC.

    Enable JDBC.

    Enabling JDBC will also enable the cluster.

    returns

    A copy of this setup.

  4. def withSsl(): Setup

    Enable the SSL port.

    Enable the SSL port.

    returns

    A copy of this setup.

    Annotations
    @ApiMayChange()