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. 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 TestServer[A] to any2stringadd[TestServer[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (TestServer[A], B)
    Implicit
    This member is added by an implicit conversion from TestServer[A] to ArrowAssoc[TestServer[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def actorSystem: ActorSystem

    Convenient access to the actor system

  7. val application: A
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. val clientSslContext: Option[SSLContext]
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  11. def ensuring(cond: (TestServer[A]) ⇒ Boolean, msg: ⇒ Any): TestServer[A]
    Implicit
    This member is added by an implicit conversion from TestServer[A] to Ensuring[TestServer[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (TestServer[A]) ⇒ Boolean): TestServer[A]
    Implicit
    This member is added by an implicit conversion from TestServer[A] to Ensuring[TestServer[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: ⇒ Any): TestServer[A]
    Implicit
    This member is added by an implicit conversion from TestServer[A] to Ensuring[TestServer[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): TestServer[A]
    Implicit
    This member is added by an implicit conversion from TestServer[A] to Ensuring[TestServer[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. implicit def executionContext: ExecutionContext

    Convenient access to the execution context

  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from TestServer[A] to StringFormat[TestServer[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. implicit def materializer: Materializer

    Convenient access to the materializer

  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. val playServer: Server
  28. def serviceClient: ServiceClient

    Convenient access to the service client

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

  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  35. def [B](y: B): (TestServer[A], B)
    Implicit
    This member is added by an implicit conversion from TestServer[A] to ArrowAssoc[TestServer[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from TestServer[A] to any2stringadd[TestServer[A]]

Inherited by implicit conversion StringFormat from TestServer[A] to StringFormat[TestServer[A]]

Inherited by implicit conversion Ensuring from TestServer[A] to Ensuring[TestServer[A]]

Inherited by implicit conversion ArrowAssoc from TestServer[A] to ArrowAssoc[TestServer[A]]

Ungrouped