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

class TestServer 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

Instance Constructors

  1. new TestServer(port: Int, app: Application, server: Server, clientSslContext: Optional[SSLContext] = Optional.empty())

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 to any2stringadd[TestServer] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (TestServer, B)
    Implicit
    This member is added by an implicit conversion from TestServer to ArrowAssoc[TestServer] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. val app: Application
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def client[S <: Service](serviceClass: Class[S]): S

    Get the service client for a service.

  9. val clientSslContext: Optional[SSLContext]
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  11. def ensuring(cond: (TestServer) ⇒ Boolean, msg: ⇒ Any): TestServer
    Implicit
    This member is added by an implicit conversion from TestServer to Ensuring[TestServer] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (TestServer) ⇒ Boolean): TestServer
    Implicit
    This member is added by an implicit conversion from TestServer to Ensuring[TestServer] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: ⇒ Any): TestServer
    Implicit
    This member is added by an implicit conversion from TestServer to Ensuring[TestServer] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): TestServer
    Implicit
    This member is added by an implicit conversion from TestServer to Ensuring[TestServer] 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. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from TestServer to StringFormat[TestServer] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  19. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def injector: Injector

    The Guice injector that can be used for retrieving anything that has been bound to Guice.

  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def materializer: Materializer

    Stream materializer.

    Stream materializer. Useful for Akka Streams TestKit.

  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 port: Int
  28. val portSsl: Optional[Integer]
  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 system: ActorSystem

    Current Akka ActorSystem.

    Current Akka ActorSystem. Useful for Akka Streams TestKit.

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

Inherited from AnyRef

Inherited from Any

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

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

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

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

Ungrouped