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

final class TestServer[A <: LagomApplication] extends AnyRef

When the server is started you can get the service client and other Guice bindings here.

Source
ServiceTest.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TestServer
  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

Value Members

  1. def actorSystem: ActorSystem

    Convenient access to the actor system

  2. val application: A
  3. val clientSslContext: Option[SSLContext]
  4. implicit def executionContext: ExecutionContext

    Convenient access to the execution context

  5. implicit def materializer: Materializer

    Convenient access to the materializer

  6. val playServer: Server
  7. def serviceClient: ServiceClient

    Convenient access to the service client

  8. def stop(): Unit

    If you use startServer you must also stop the server with this method when the test is finished.

    If you use startServer you must also stop the server with this method when the test is finished. That is handled automatically by withServer.