Packages

o

play.api.test

Helpers

object Helpers extends PlayRunners with HeaderNames with Status with MimeTypes with HttpProtocol with DefaultAwaitTimeout with ResultExtractors with Writeables with EssentialActionCaller with RouteInvokers with FutureAwaits with StubControllerComponentsFactory

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Helpers
  2. StubControllerComponentsFactory
  3. StubMessagesFactory
  4. StubBodyParserFactory
  5. StubPlayBodyParsersFactory
  6. FutureAwaits
  7. RouteInvokers
  8. EssentialActionCaller
  9. Writeables
  10. ResultExtractors
  11. DefaultAwaitTimeout
  12. HttpProtocol
  13. MimeTypes
  14. Status
  15. HeaderNames
  16. PlayRunners
  17. HttpVerbs
  18. AnyRef
  19. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class NegativeTimeout(t: Timeout) extends Product with Serializable

    How long we should wait for something that we expect *not* to happen, e.g.

    How long we should wait for something that we expect *not* to happen, e.g. waiting to make sure that a channel is *not* closed by some concurrent process.

    NegativeTimeout is a separate type to a normal Timeout because we'll want to set it to a lower value. This is because in normal usage we'll need to wait for the full length of time to show that nothing has happened in that time. If the value is too high then we'll spend a lot of time waiting during normal usage. If it is too low, however, we may miss events that occur after the timeout has finished. This is a necessary trade-off.

    Where possible, tests should avoid using a NegativeTimeout. Tests will often know exactly when an event should occur. In this case they can perform a check for the event immediately rather than using using NegativeTimeout.

    Definition Classes
    DefaultAwaitTimeout

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val ACCEPT: String
    Definition Classes
    HeaderNames
  5. val ACCEPTED: Int
    Definition Classes
    Status
  6. val ACCEPT_CHARSET: String
    Definition Classes
    HeaderNames
  7. val ACCEPT_ENCODING: String
    Definition Classes
    HeaderNames
  8. val ACCEPT_LANGUAGE: String
    Definition Classes
    HeaderNames
  9. val ACCEPT_RANGES: String
    Definition Classes
    HeaderNames
  10. val ACCESS_CONTROL_ALLOW_CREDENTIALS: String
    Definition Classes
    HeaderNames
  11. val ACCESS_CONTROL_ALLOW_HEADERS: String
    Definition Classes
    HeaderNames
  12. val ACCESS_CONTROL_ALLOW_METHODS: String
    Definition Classes
    HeaderNames
  13. val ACCESS_CONTROL_ALLOW_ORIGIN: String
    Definition Classes
    HeaderNames
  14. val ACCESS_CONTROL_EXPOSE_HEADERS: String
    Definition Classes
    HeaderNames
  15. val ACCESS_CONTROL_MAX_AGE: String
    Definition Classes
    HeaderNames
  16. val ACCESS_CONTROL_REQUEST_HEADERS: String
    Definition Classes
    HeaderNames
  17. val ACCESS_CONTROL_REQUEST_METHOD: String
    Definition Classes
    HeaderNames
  18. val AGE: String
    Definition Classes
    HeaderNames
  19. val ALLOW: String
    Definition Classes
    HeaderNames
  20. val AUTHORIZATION: String
    Definition Classes
    HeaderNames
  21. val BAD_GATEWAY: Int
    Definition Classes
    Status
  22. val BAD_REQUEST: Int
    Definition Classes
    Status
  23. val BINARY: String

    Content-Type of binary data.

    Content-Type of binary data.

    Definition Classes
    MimeTypes
  24. val CACHE_CONTROL: String
    Definition Classes
    HeaderNames
  25. val CACHE_MANIFEST: String

    Content-Type of application cache.

    Content-Type of application cache.

    Definition Classes
    MimeTypes
  26. val CHUNKED: String
    Definition Classes
    HttpProtocol
  27. val CONFLICT: Int
    Definition Classes
    Status
  28. val CONNECTION: String
    Definition Classes
    HeaderNames
  29. val CONTENT_DISPOSITION: String
    Definition Classes
    HeaderNames
  30. val CONTENT_ENCODING: String
    Definition Classes
    HeaderNames
  31. val CONTENT_LANGUAGE: String
    Definition Classes
    HeaderNames
  32. val CONTENT_LENGTH: String
    Definition Classes
    HeaderNames
  33. val CONTENT_LOCATION: String
    Definition Classes
    HeaderNames
  34. val CONTENT_MD5: String
    Definition Classes
    HeaderNames
  35. val CONTENT_RANGE: String
    Definition Classes
    HeaderNames
  36. val CONTENT_SECURITY_POLICY: String
    Definition Classes
    HeaderNames
  37. val CONTENT_SECURITY_POLICY_REPORT_ONLY: String
    Definition Classes
    HeaderNames
  38. val CONTENT_TRANSFER_ENCODING: String
    Definition Classes
    HeaderNames
  39. val CONTENT_TYPE: String
    Definition Classes
    HeaderNames
  40. val CONTINUE: Int
    Definition Classes
    Status
  41. val COOKIE: String
    Definition Classes
    HeaderNames
  42. val CREATED: Int
    Definition Classes
    Status
  43. val CSS: String

    Content-Type of css.

    Content-Type of css.

    Definition Classes
    MimeTypes
  44. val DATE: String
    Definition Classes
    HeaderNames
  45. val DELETE: String
    Definition Classes
    HttpVerbs
  46. val ETAG: String
    Definition Classes
    HeaderNames
  47. val EVENT_STREAM: String

    Content-Type of server sent events.

    Content-Type of server sent events.

    Definition Classes
    MimeTypes
  48. val EXPECT: String
    Definition Classes
    HeaderNames
  49. val EXPECTATION_FAILED: Int
    Definition Classes
    Status
  50. val EXPIRES: String
    Definition Classes
    HeaderNames
  51. val FAILED_DEPENDENCY: Int
    Definition Classes
    Status
  52. val FIREFOX: Class[FirefoxDriver]
    Definition Classes
    PlayRunners
  53. val FORBIDDEN: Int
    Definition Classes
    Status
  54. val FORM: String

    Content-Type of form-urlencoded.

    Content-Type of form-urlencoded.

    Definition Classes
    MimeTypes
  55. val FORWARDED: String
    Definition Classes
    HeaderNames
  56. val FOUND: Int
    Definition Classes
    Status
  57. val FROM: String
    Definition Classes
    HeaderNames
  58. val GATEWAY_TIMEOUT: Int
    Definition Classes
    Status
  59. val GET: String
    Definition Classes
    HttpVerbs
  60. val GONE: Int
    Definition Classes
    Status
  61. val HEAD: String
    Definition Classes
    HttpVerbs
  62. val HOST: String
    Definition Classes
    HeaderNames
  63. val HTML: String

    Content-Type of html.

    Content-Type of html.

    Definition Classes
    MimeTypes
  64. val HTMLUNIT: Class[HtmlUnitDriver]
    Definition Classes
    PlayRunners
  65. val HTTP_1_0: String
    Definition Classes
    HttpProtocol
  66. val HTTP_1_1: String
    Definition Classes
    HttpProtocol
  67. val HTTP_2_0: String
    Definition Classes
    HttpProtocol
  68. val HTTP_VERSION_NOT_SUPPORTED: Int
    Definition Classes
    Status
  69. val IF_MATCH: String
    Definition Classes
    HeaderNames
  70. val IF_MODIFIED_SINCE: String
    Definition Classes
    HeaderNames
  71. val IF_NONE_MATCH: String
    Definition Classes
    HeaderNames
  72. val IF_RANGE: String
    Definition Classes
    HeaderNames
  73. val IF_UNMODIFIED_SINCE: String
    Definition Classes
    HeaderNames
  74. val IM_A_TEAPOT: Int
    Definition Classes
    Status
  75. val INSUFFICIENT_STORAGE: Int
    Definition Classes
    Status
  76. val INTERNAL_SERVER_ERROR: Int
    Definition Classes
    Status
  77. val JAVASCRIPT: String

    Content-Type of javascript.

    Content-Type of javascript.

    Definition Classes
    MimeTypes
  78. val JSON: String

    Content-Type of json.

    Content-Type of json.

    Definition Classes
    MimeTypes
  79. val LAST_MODIFIED: String
    Definition Classes
    HeaderNames
  80. val LENGTH_REQUIRED: Int
    Definition Classes
    Status
  81. val LINK: String
    Definition Classes
    HeaderNames
  82. val LOCATION: String
    Definition Classes
    HeaderNames
  83. val LOCKED: Int
    Definition Classes
    Status
  84. val MAX_FORWARDS: String
    Definition Classes
    HeaderNames
  85. val METHOD_NOT_ALLOWED: Int
    Definition Classes
    Status
  86. val MOVED_PERMANENTLY: Int
    Definition Classes
    Status
  87. val MULTIPLE_CHOICES: Int
    Definition Classes
    Status
  88. val MULTI_STATUS: Int
    Definition Classes
    Status
  89. val NETWORK_AUTHENTICATION_REQUIRED: Int
    Definition Classes
    Status
  90. val NON_AUTHORITATIVE_INFORMATION: Int
    Definition Classes
    Status
  91. val NOT_ACCEPTABLE: Int
    Definition Classes
    Status
  92. val NOT_FOUND: Int
    Definition Classes
    Status
  93. val NOT_IMPLEMENTED: Int
    Definition Classes
    Status
  94. val NOT_MODIFIED: Int
    Definition Classes
    Status
  95. val NO_CONTENT: Int
    Definition Classes
    Status
  96. val OK: Int
    Definition Classes
    Status
  97. val OPTIONS: String
    Definition Classes
    HttpVerbs
  98. val ORIGIN: String
    Definition Classes
    HeaderNames
  99. val PARTIAL_CONTENT: Int
    Definition Classes
    Status
  100. val PATCH: String
    Definition Classes
    HttpVerbs
  101. val PAYMENT_REQUIRED: Int
    Definition Classes
    Status
  102. val PERMANENT_REDIRECT: Int
    Definition Classes
    Status
  103. val POST: String
    Definition Classes
    HttpVerbs
  104. val PRAGMA: String
    Definition Classes
    HeaderNames
  105. val PRECONDITION_FAILED: Int
    Definition Classes
    Status
  106. val PRECONDITION_REQUIRED: Int
    Definition Classes
    Status
  107. val PROXY_AUTHENTICATE: String
    Definition Classes
    HeaderNames
  108. val PROXY_AUTHENTICATION_REQUIRED: Int
    Definition Classes
    Status
  109. val PROXY_AUTHORIZATION: String
    Definition Classes
    HeaderNames
  110. val PUT: String
    Definition Classes
    HttpVerbs
  111. val RANGE: String
    Definition Classes
    HeaderNames
  112. val REFERER: String
    Definition Classes
    HeaderNames
  113. val REFERRER_POLICY: String
    Definition Classes
    HeaderNames
  114. val REQUESTED_RANGE_NOT_SATISFIABLE: Int
    Definition Classes
    Status
  115. val REQUEST_ENTITY_TOO_LARGE: Int
    Definition Classes
    Status
  116. val REQUEST_HEADER_FIELDS_TOO_LARGE: Int
    Definition Classes
    Status
  117. val REQUEST_TIMEOUT: Int
    Definition Classes
    Status
  118. val REQUEST_URI_TOO_LONG: Int
    Definition Classes
    Status
  119. val RESET_CONTENT: Int
    Definition Classes
    Status
  120. val RETRY_AFTER: String
    Definition Classes
    HeaderNames
  121. val SEE_OTHER: Int
    Definition Classes
    Status
  122. val SERVER: String
    Definition Classes
    HeaderNames
  123. val SERVICE_UNAVAILABLE: Int
    Definition Classes
    Status
  124. val SET_COOKIE: String
    Definition Classes
    HeaderNames
  125. val SET_COOKIE2: String
    Definition Classes
    HeaderNames
  126. val STRICT_TRANSPORT_SECURITY: String
    Definition Classes
    HeaderNames
  127. val SWITCHING_PROTOCOLS: Int
    Definition Classes
    Status
  128. val TE: String
    Definition Classes
    HeaderNames
  129. val TEMPORARY_REDIRECT: Int
    Definition Classes
    Status
  130. val TEXT: String

    Content-Type of text.

    Content-Type of text.

    Definition Classes
    MimeTypes
  131. val TOO_MANY_REQUESTS: Int
    Definition Classes
    Status
  132. val TRAILER: String
    Definition Classes
    HeaderNames
  133. val TRANSFER_ENCODING: String
    Definition Classes
    HeaderNames
  134. val UNAUTHORIZED: Int
    Definition Classes
    Status
  135. val UNPROCESSABLE_ENTITY: Int
    Definition Classes
    Status
  136. val UNSUPPORTED_MEDIA_TYPE: Int
    Definition Classes
    Status
  137. val UPGRADE: String
    Definition Classes
    HeaderNames
  138. val UPGRADE_REQUIRED: Int
    Definition Classes
    Status
  139. val USER_AGENT: String
    Definition Classes
    HeaderNames
  140. val USE_PROXY: Int
    Definition Classes
    Status
  141. val VARY: String
    Definition Classes
    HeaderNames
  142. val VIA: String
    Definition Classes
    HeaderNames
  143. val WARNING: String
    Definition Classes
    HeaderNames
  144. val WWW_AUTHENTICATE: String
    Definition Classes
    HeaderNames
  145. val XHTML: String

    Content-Type of xhtml.

    Content-Type of xhtml.

    Definition Classes
    MimeTypes
  146. val XML: String

    Content-Type of xml.

    Content-Type of xml.

    Definition Classes
    MimeTypes
  147. val X_CONTENT_SECURITY_POLICY_NONCE_HEADER: String
    Definition Classes
    HeaderNames
  148. val X_CONTENT_TYPE_OPTIONS: String
    Definition Classes
    HeaderNames
  149. val X_FORWARDED_FOR: String
    Definition Classes
    HeaderNames
  150. val X_FORWARDED_HOST: String
    Definition Classes
    HeaderNames
  151. val X_FORWARDED_PORT: String
    Definition Classes
    HeaderNames
  152. val X_FORWARDED_PROTO: String
    Definition Classes
    HeaderNames
  153. val X_FRAME_OPTIONS: String
    Definition Classes
    HeaderNames
  154. val X_PERMITTED_CROSS_DOMAIN_POLICIES: String
    Definition Classes
    HeaderNames
  155. val X_REQUESTED_WITH: String
    Definition Classes
    HeaderNames
  156. val X_XSS_PROTECTION: String
    Definition Classes
    HeaderNames
  157. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  158. def await[T](future: Future[T], timeout: Long, unit: TimeUnit): T

    Block until a Promise is redeemed with the specified timeout.

    Block until a Promise is redeemed with the specified timeout.

    Definition Classes
    FutureAwaits
  159. def await[T](future: Future[T])(implicit timeout: Timeout): T

    Block until a Promise is redeemed.

    Block until a Promise is redeemed.

    Definition Classes
    FutureAwaits
  160. lazy val baseApplicationBuilder: GuiceApplicationBuilder

    The base builder used in the running method.

    The base builder used in the running method.

    Definition Classes
    PlayRunners
  161. def call[T](action: EssentialAction, rh: RequestHeader, body: T)(implicit w: Writeable[T], mat: Materializer): Future[Result]

    Execute an play.api.mvc.EssentialAction.

    Execute an play.api.mvc.EssentialAction.

    The body is serialised using the implicit writable, so that the action body parser can deserialize it.

    Definition Classes
    EssentialActionCaller
  162. def call[T](action: EssentialAction, req: Request[T])(implicit w: Writeable[T], mat: Materializer): Future[Result]

    Execute an play.api.mvc.EssentialAction.

    Execute an play.api.mvc.EssentialAction.

    The body is serialised using the implicit writable, so that the action body parser can deserialize it.

    Definition Classes
    EssentialActionCaller
  163. def charset(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Option[String]

    Extracts the Charset of this Result value.

    Extracts the Charset of this Result value.

    Definition Classes
    ResultExtractors
  164. def charset(of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts the Charset of this Result value.

    Extracts the Charset of this Result value.

    Definition Classes
    ResultExtractors
  165. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  166. def contentAsBytes(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): ByteString

    Extracts the content as bytes.

    Extracts the content as bytes.

    Definition Classes
    ResultExtractors
  167. def contentAsBytes(of: Future[Result])(implicit timeout: Timeout, mat: Materializer = NoMaterializer): ByteString

    Extracts the content as bytes.

    Extracts the content as bytes.

    Definition Classes
    ResultExtractors
  168. def contentAsBytes(of: Content)(implicit timeout: Timeout): Array[Byte]

    Extracts the content as bytes.

    Extracts the content as bytes.

    Definition Classes
    ResultExtractors
  169. def contentAsJson(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): JsValue

    Extracts the content as Json.

    Extracts the content as Json.

    Definition Classes
    ResultExtractors
  170. def contentAsJson(of: Future[Result])(implicit timeout: Timeout, mat: Materializer = NoMaterializer): JsValue

    Extracts the content as Json.

    Extracts the content as Json.

    Definition Classes
    ResultExtractors
  171. def contentAsJson(of: Content)(implicit timeout: Timeout): JsValue

    Extracts the content as Json.

    Extracts the content as Json.

    Definition Classes
    ResultExtractors
  172. def contentAsString(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): String

    Extracts the content as String.

    Extracts the content as String.

    Definition Classes
    ResultExtractors
  173. def contentAsString(of: Future[Result])(implicit timeout: Timeout, mat: Materializer = NoMaterializer): String

    Extracts the content as String.

    Extracts the content as String.

    Definition Classes
    ResultExtractors
  174. def contentAsString(of: Content)(implicit timeout: Timeout): String

    Extracts the content as String.

    Extracts the content as String.

    Definition Classes
    ResultExtractors
  175. def contentType(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Option[String]

    Extracts the Content-Type of this Result value.

    Extracts the Content-Type of this Result value.

    Definition Classes
    ResultExtractors
  176. def contentType(of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts the Content-Type of this Result value.

    Extracts the Content-Type of this Result value.

    Definition Classes
    ResultExtractors
  177. def contentType(of: Content)(implicit timeout: Timeout): String

    Extracts the Content-Type of this Content value.

    Extracts the Content-Type of this Content value.

    Definition Classes
    ResultExtractors
  178. def cookies(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Cookies

    Extracts the Cookies set by this Result value.

    Extracts the Cookies set by this Result value.

    Definition Classes
    ResultExtractors
  179. def cookies(of: Future[Result])(implicit timeout: Timeout): Cookies

    Gets the Cookies associated with this Result value.

    Gets the Cookies associated with this Result value. Note that this only extracts the "new" cookies added to this result (e.g. through withCookies), not including the Session or Flash. The final set of cookies may be different because the Play server automatically adds those cookies and merges the headers.

    Definition Classes
    ResultExtractors
  180. implicit def defaultAwaitTimeout: Timeout

    The default await timeout.

    The default await timeout. Override this to change it.

    Definition Classes
    DefaultAwaitTimeout
  181. implicit val defaultNegativeTimeout: NegativeTimeout
    Definition Classes
    DefaultAwaitTimeout
  182. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  183. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  184. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  185. def flash(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Flash

    Extracts the Flash values set by this Result value.

    Extracts the Flash values set by this Result value.

    Definition Classes
    ResultExtractors
  186. def flash(of: Future[Result])(implicit timeout: Timeout): Flash

    Extracts the Flash values set by this Result value.

    Extracts the Flash values set by this Result value.

    Definition Classes
    ResultExtractors
  187. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  188. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  189. def header(header: String, of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Option[String]

    Extracts an Header value of this Result value.

    Extracts an Header value of this Result value.

    Definition Classes
    ResultExtractors
  190. def header(header: String, of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts an Header value of this Result value.

    Extracts an Header value of this Result value.

    Definition Classes
    ResultExtractors
  191. def headers(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Map[String, String]

    Extracts all Headers of this Result value.

    Extracts all Headers of this Result value.

    Definition Classes
    ResultExtractors
  192. def headers(of: Future[Result])(implicit timeout: Timeout): Map[String, String]

    Extracts all Headers of this Result value.

    Extracts all Headers of this Result value.

    Definition Classes
    ResultExtractors
  193. def inMemoryDatabase(name: String = "default", options: Map[String, String] = Map.empty[String, String]): Map[String, String]

    Constructs a in-memory (h2) database configuration to add to an Application.

    Constructs a in-memory (h2) database configuration to add to an Application.

    Definition Classes
    PlayRunners
  194. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  195. def jRoute[T](app: Application, r: RequestHeader, body: RequestBody): Option[Future[Result]]
    Definition Classes
    RouteInvokers
  196. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  197. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  198. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  199. def redirectLocation(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Option[String]

    Extracts the Location header of this Result value if this Result is a Redirect.

    Extracts the Location header of this Result value if this Result is a Redirect.

    Definition Classes
    ResultExtractors
  200. def redirectLocation(of: Future[Result])(implicit timeout: Timeout): Option[String]

    Extracts the Location header of this Result value if this Result is a Redirect.

    Extracts the Location header of this Result value if this Result is a Redirect.

    Definition Classes
    ResultExtractors
  201. def route[T](app: Application, req: Request[T])(implicit w: Writeable[T]): Option[Future[Result]]

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    The body is serialised using the implicit writable, so that the action body parser can deserialize it.

    Definition Classes
    RouteInvokers
  202. def route[T](app: Application, rh: RequestHeader, body: T)(implicit w: Writeable[T]): Option[Future[Result]]

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    Use the HttpRequestHandler to determine the Action to call for this request and execute it.

    The body is serialised using the implicit writable, so that the action body parser can deserialize it.

    Definition Classes
    RouteInvokers
  203. def running[T](testServer: TestServer, webDriver: WebDriver)(block: (TestBrowser) ⇒ T): T

    Executes a block of code in a running server, with a test browser.

    Executes a block of code in a running server, with a test browser.

    Definition Classes
    PlayRunners
  204. def running[T, WEBDRIVER <: WebDriver](testServer: TestServer, webDriver: Class[WEBDRIVER])(block: (TestBrowser) ⇒ T): T

    Executes a block of code in a running server, with a test browser.

    Executes a block of code in a running server, with a test browser.

    Definition Classes
    PlayRunners
  205. def running[T](testServer: TestServer)(block: ⇒ T): T

    Executes a block of code in a running server.

    Executes a block of code in a running server.

    Definition Classes
    PlayRunners
  206. def running[T](builder: (GuiceApplicationBuilder) ⇒ GuiceApplicationBuilder)(block: (Application) ⇒ T): T
    Definition Classes
    PlayRunners
  207. def running[T](app: Application)(block: ⇒ T): T

    Executes a block of code in a running application.

    Executes a block of code in a running application.

    Definition Classes
    PlayRunners
  208. def running[T]()(block: (Application) ⇒ T): T
    Definition Classes
    PlayRunners
  209. def session(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Session

    Extracts the Session set by this Result value.

    Extracts the Session set by this Result value.

    Definition Classes
    ResultExtractors
  210. def session(of: Future[Result])(implicit timeout: Timeout): Session

    Extracts the Session values set by this Result value.

    Extracts the Session values set by this Result value.

    Definition Classes
    ResultExtractors
  211. def shouldRunSequentially(app: Application): Boolean

    Tests using servers share a test server port so we default to true.

    Tests using servers share a test server port so we default to true.

    Attributes
    protected
    Definition Classes
    PlayRunners
  212. def status(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Int

    Extracts the Status code of this Result value.

    Extracts the Status code of this Result value.

    Definition Classes
    ResultExtractors
  213. def status(of: Future[Result])(implicit timeout: Timeout): Int

    Extracts the Status code of this Result value.

    Extracts the Status code of this Result value.

    Definition Classes
    ResultExtractors
  214. def stubBodyParser[T](content: T = AnyContentAsEmpty): BodyParser[T]

    Stub method that returns the content immediately.

    Stub method that returns the content immediately. Useful for unit testing.

    val stubParser = bodyParser(AnyContent("hello"))
    content

    the content to return, AnyContentAsEmpty by default

    returns

    a BodyParser for type T that returns Accumulator.done(Right(content))

    Definition Classes
    StubBodyParserFactory
  215. def stubControllerComponents(bodyParser: BodyParser[AnyContent] = stubBodyParser(AnyContentAsEmpty), playBodyParsers: PlayBodyParsers = stubPlayBodyParsers(NoMaterializer), messagesApi: MessagesApi = stubMessagesApi(), langs: Langs = stubLangs(), fileMimeTypes: FileMimeTypes = ..., executionContext: ExecutionContext = ExecutionContext.global): ControllerComponents

    Create a minimal controller components, useful for unit testing.

    Create a minimal controller components, useful for unit testing.

    In most cases, you'll want the standard defaults:

    val controller = new MyController(stubControllerComponents())

    A custom body parser can be used with bodyParser() to provide a request body to the controller:

    val cc = stubControllerComponents(bodyParser(AnyContent("request body text")))
    bodyParser

    the body parser used to parse any content, stubBodyParser(AnyContentAsEmpty) by default.

    playBodyParsers

    the playbodyparsers, defaults to stubPlayBodyParsers(NoMaterializer)

    langs

    the langs instance for messaging, new DefaultLangs() by default.

    fileMimeTypes

    the mime type associated with file extensions, new DefaultFileMimeTypes(FileMimeTypesConfiguration() by default.

    executionContext

    an execution context, defaults to ExecutionContext.global

    returns

    a fully configured ControllerComponents instance.

    Definition Classes
    StubControllerComponentsFactory
  216. def stubLangs(availables: Seq[Lang] = Seq(Lang.defaultLang)): Langs

    availables

    default as Seq(Lang.defaultLang).

    returns

    a stub Langs

    Definition Classes
    StubMessagesFactory
  217. def stubMessages(messagesApi: MessagesApi = stubMessagesApi(), requestHeader: RequestHeader = FakeRequest()): Messages

    Stub method that returns a play.api.i18n.Messages instance.

    Stub method that returns a play.api.i18n.Messages instance.

    messagesApi

    the messagesApi to use, uses stubMessagesApi by default.

    requestHeader

    the request to use, FakeRequest by default.

    returns

    the Messages instance

    Definition Classes
    StubMessagesFactory
  218. def stubMessagesApi(messages: Map[String, Map[String, String]] = Map.empty, langs: Langs = stubLangs(), langCookieName: String = "PLAY_LANG", langCookieSecure: Boolean = false, langCookieHttpOnly: Boolean = false, langCookieSameSite: Option[SameSite] = None, httpConfiguration: HttpConfiguration = HttpConfiguration(), langCookieMaxAge: Option[Int] = None): MessagesApi

    Returns a stub DefaultMessagesApi with default values and an empty map.

    Returns a stub DefaultMessagesApi with default values and an empty map.

    messages

    map of languages to map of messages, empty by default.

    langs

    stubLangs() by default

    langCookieName

    "PLAY_LANG" by default

    langCookieSecure

    false by default

    langCookieHttpOnly

    false by default

    langCookieSameSite

    None by default

    httpConfiguration

    configuration, HttpConfiguration() by default.

    langCookieMaxAge

    None by default

    returns

    the messagesApi with minimal configuration.

    Definition Classes
    StubMessagesFactory
  219. def stubMessagesControllerComponents(): MessagesControllerComponents
  220. def stubMessagesRequest(messagesApi: MessagesApi = stubMessagesApi(), request: Request[AnyContentAsEmpty.type] = FakeRequest()): MessagesRequest[AnyContentAsEmpty.type]

    Stub method that returns a play.api.mvc.MessagesRequest instance.

    Stub method that returns a play.api.mvc.MessagesRequest instance.

    messagesApi

    the messagesApi to use, uses stubMessagesApi by default.

    request

    the request to use, FakeRequest by default.

    returns

    the Messages instance

    Definition Classes
    StubMessagesFactory
  221. def stubPlayBodyParsers(implicit mat: Materializer): PlayBodyParsers

    Stub method for unit testing, using NoTemporaryFileCreator.

    Stub method for unit testing, using NoTemporaryFileCreator.

    mat

    the input materializer.

    returns

    a minimal PlayBodyParsers for unit testing.

    Definition Classes
    StubPlayBodyParsersFactory
  222. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  223. lazy val testServerPort: Int

    The port to use for a test server.

    The port to use for a test server. Defaults to 19001. May be configured using the system property testserver.port

    Definition Classes
    PlayRunners
  224. def toString(): String
    Definition Classes
    AnyRef → Any
  225. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  226. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  227. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  228. implicit def writeableOf_AnyContentAsEmpty(implicit code: Codec): Writeable[AnyContentAsEmpty.type]
    Definition Classes
    Writeables
  229. implicit def writeableOf_AnyContentAsFormUrlEncoded(implicit code: Codec): Writeable[AnyContentAsFormUrlEncoded]
    Definition Classes
    Writeables
  230. implicit def writeableOf_AnyContentAsJson: Writeable[AnyContentAsJson]
    Definition Classes
    Writeables
  231. def writeableOf_AnyContentAsJson(codec: Codec, contentType: Option[String] = None): Writeable[AnyContentAsJson]
    Definition Classes
    Writeables
  232. implicit def writeableOf_AnyContentAsMultipartForm(contentType: Option[String])(implicit codec: Codec): Writeable[AnyContentAsMultipartFormData]
    Definition Classes
    Writeables
  233. implicit def writeableOf_AnyContentAsMultipartForm(implicit codec: Codec): Writeable[AnyContentAsMultipartFormData]
    Definition Classes
    Writeables
  234. implicit def writeableOf_AnyContentAsRaw: Writeable[AnyContentAsRaw]
    Definition Classes
    Writeables
  235. implicit def writeableOf_AnyContentAsText(implicit code: Codec): Writeable[AnyContentAsText]
    Definition Classes
    Writeables
  236. implicit def writeableOf_AnyContentAsXml(implicit codec: Codec): Writeable[AnyContentAsXml]
    Definition Classes
    Writeables

Inherited from StubMessagesFactory

Inherited from StubBodyParserFactory

Inherited from FutureAwaits

Inherited from RouteInvokers

Inherited from EssentialActionCaller

Inherited from Writeables

Inherited from ResultExtractors

Inherited from DefaultAwaitTimeout

Inherited from HttpProtocol

Inherited from MimeTypes

Inherited from Status

Inherited from HeaderNames

Inherited from PlayRunners

Inherited from HttpVerbs

Inherited from AnyRef

Inherited from Any

Ungrouped