Packages

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

    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 configureBuilder: Function[GuiceApplicationBuilder, GuiceApplicationBuilder]

    The builder configuration function

  4. abstract def configureBuilder(configureBuilder: Function[GuiceApplicationBuilder, GuiceApplicationBuilder]): Setup

    Configure the builder.

    Configure the builder.

    Allows a function to be supplied to configure the Play Guice application builder. This allows components to be mocked, modules to be enabled/disabled, and custom configuration to be supplied.

    configureBuilder

    The builder configuration function.

    returns

    A copy of this setup.

  5. abstract def jdbc: Boolean

    Whether JDBC is enabled.

  6. abstract def ssl: Boolean

    Whether HTTPS is enabled.

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

    Enable or disable Cassandra.

    Enable or disable 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.

    enabled

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

    returns

    A copy of this setup.

  8. 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.

  9. 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.

  10. 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. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Setup to any2stringadd[Setup] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Setup, B)
    Implicit
    This member is added by an implicit conversion from Setup to ArrowAssoc[Setup] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. def ensuring(cond: (Setup) ⇒ Boolean, msg: ⇒ Any): Setup
    Implicit
    This member is added by an implicit conversion from Setup to Ensuring[Setup] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (Setup) ⇒ Boolean): Setup
    Implicit
    This member is added by an implicit conversion from Setup to Ensuring[Setup] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): Setup
    Implicit
    This member is added by an implicit conversion from Setup to Ensuring[Setup] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): Setup
    Implicit
    This member is added by an implicit conversion from Setup to Ensuring[Setup] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Setup to StringFormat[Setup] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  27. 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.

  28. 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.

  29. def withJdbc(): Setup

    Enable JDBC.

    Enable JDBC.

    Enabling JDBC will also enable the cluster.

    returns

    A copy of this setup.

  30. def withSsl(): Setup

    Enable the SSL port.

    Enable the SSL port.

    returns

    A copy of this setup.

    Annotations
    @ApiMayChange()
  31. def [B](y: B): (Setup, B)
    Implicit
    This member is added by an implicit conversion from Setup to ArrowAssoc[Setup] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def withConfigureBuilder(configureBuilder: Function[GuiceApplicationBuilder, GuiceApplicationBuilder]): Setup
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use configureBuilder instead

  2. def withPersistence(enabled: Boolean): Setup
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Use withCassandra instead

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Setup to any2stringadd[Setup]

Inherited by implicit conversion StringFormat from Setup to StringFormat[Setup]

Inherited by implicit conversion Ensuring from Setup to Ensuring[Setup]

Inherited by implicit conversion ArrowAssoc from Setup to ArrowAssoc[Setup]

Ungrouped