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

    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_TRANSFER_ENCODING: String
    Definition Classes
    HeaderNames
  37. val CONTENT_TYPE: String
    Definition Classes
    HeaderNames
  38. val CONTINUE: Int
    Definition Classes
    Status
  39. val COOKIE: String
    Definition Classes
    HeaderNames
  40. val CREATED: Int
    Definition Classes
    Status
  41. val CSS: String

    Content-Type of css.

    Content-Type of css.

    Definition Classes
    MimeTypes
  42. val DATE: String
    Definition Classes
    HeaderNames
  43. val DELETE: String
    Definition Classes
    HttpVerbs
  44. val ETAG: String
    Definition Classes
    HeaderNames
  45. val EVENT_STREAM: String

    Content-Type of server sent events.

    Content-Type of server sent events.

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

    Content-Type of form-urlencoded.

    Content-Type of form-urlencoded.

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

    Content-Type of html.

    Content-Type of html.

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

    Content-Type of javascript.

    Content-Type of javascript.

    Definition Classes
    MimeTypes
  75. val JSON: String

    Content-Type of json.

    Content-Type of json.

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

    Content-Type of text.

    Content-Type of text.

    Definition Classes
    MimeTypes
  125. val TOO_MANY_REQUESTS: Int
    Definition Classes
    Status
  126. val TRAILER: String
    Definition Classes
    HeaderNames
  127. val TRANSFER_ENCODING: String
    Definition Classes
    HeaderNames
  128. val UNAUTHORIZED: Int
    Definition Classes
    Status
  129. val UNPROCESSABLE_ENTITY: Int
    Definition Classes
    Status
  130. val UNSUPPORTED_MEDIA_TYPE: Int
    Definition Classes
    Status
  131. val UPGRADE: String
    Definition Classes
    HeaderNames
  132. val UPGRADE_REQUIRED: Int
    Definition Classes
    Status
  133. val USER_AGENT: String
    Definition Classes
    HeaderNames
  134. val USE_PROXY: Int
    Definition Classes
    Status
  135. val VARY: String
    Definition Classes
    HeaderNames
  136. val VIA: String
    Definition Classes
    HeaderNames
  137. val WARNING: String
    Definition Classes
    HeaderNames
  138. val WWW_AUTHENTICATE: String
    Definition Classes
    HeaderNames
  139. val XHTML: String

    Content-Type of xml.

    Content-Type of xml.

    Definition Classes
    MimeTypes
  140. val XML: String

    Content-Type of xml.

    Content-Type of xml.

    Definition Classes
    MimeTypes
  141. val X_FORWARDED_FOR: String
    Definition Classes
    HeaderNames
  142. val X_FORWARDED_HOST: String
    Definition Classes
    HeaderNames
  143. val X_FORWARDED_PORT: String
    Definition Classes
    HeaderNames
  144. val X_FORWARDED_PROTO: String
    Definition Classes
    HeaderNames
  145. val X_REQUESTED_WITH: String
    Definition Classes
    HeaderNames
  146. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  147. 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
  148. 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
  149. lazy val baseApplicationBuilder: GuiceApplicationBuilder

    The base builder used in the running method.

    The base builder used in the running method.

    Definition Classes
    PlayRunners
  150. 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
  151. 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
  152. 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
  153. 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
  154. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  155. 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
  156. 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
  157. def contentAsBytes(of: Content)(implicit timeout: Timeout): Array[Byte]

    Extracts the content as bytes.

    Extracts the content as bytes.

    Definition Classes
    ResultExtractors
  158. 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
  159. 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
  160. def contentAsJson(of: Content)(implicit timeout: Timeout): JsValue

    Extracts the content as Json.

    Extracts the content as Json.

    Definition Classes
    ResultExtractors
  161. 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
  162. 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
  163. def contentAsString(of: Content)(implicit timeout: Timeout): String

    Extracts the content as String.

    Extracts the content as String.

    Definition Classes
    ResultExtractors
  164. 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
  165. 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
  166. 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
  167. 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
  168. 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
  169. implicit def defaultAwaitTimeout: Timeout

    The default await timeout.

    The default await timeout. Override this to change it.

    Definition Classes
    DefaultAwaitTimeout
  170. implicit val defaultNegativeTimeout: NegativeTimeout
    Definition Classes
    DefaultAwaitTimeout
  171. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  172. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  173. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  174. 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
  175. 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
  176. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  177. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  178. 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
  179. 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
  180. 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
  181. 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
  182. 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
  183. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  184. def jRoute[T](app: Application, r: RequestHeader, body: RequestBody): Option[Future[Result]]
    Definition Classes
    RouteInvokers
  185. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  186. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  187. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  188. 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
  189. 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
  190. 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
  191. 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
  192. 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
  193. 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
  194. 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
  195. def running[T](builder: (GuiceApplicationBuilder) ⇒ GuiceApplicationBuilder)(block: (Application) ⇒ T): T
    Definition Classes
    PlayRunners
  196. 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
  197. def running[T]()(block: (Application) ⇒ T): T
    Definition Classes
    PlayRunners
  198. 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
  199. 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
  200. def shouldRunSequentially(app: Application): Boolean

    Returns true if this application needs to run sequentially, rather than in parallel with other applications.

    Returns true if this application needs to run sequentially, rather than in parallel with other applications. Typically that means the application and/or test relies on some global state, so this defaults to the globalApplicationEnabled setting. This method is provided so the behavior can be customized if needed.

    Attributes
    protected
    Definition Classes
    PlayRunners
  201. 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
  202. 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
  203. 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
  204. 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
  205. def stubLangs(availables: Seq[Lang] = Seq(Lang.defaultLang)): Langs

    availables

    default as Seq(Lang.defaultLang).

    returns

    a stub Langs

    Definition Classes
    StubMessagesFactory
  206. 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
  207. def stubMessagesApi(messages: Map[String, Map[String, String]] = Map.empty, langs: Langs = stubLangs(), langCookieName: String = "PLAY_LANG", langCookieSecure: Boolean = false, langCookieHttpOnly: Boolean = false, httpConfiguration: HttpConfiguration = HttpConfiguration()): 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

    httpConfiguration

    configuration, HttpConfiguration() by default.

    returns

    the messagesApi with minimal configuration.

    Definition Classes
    StubMessagesFactory
  208. 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
  209. 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
  210. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  211. 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
  212. def toString(): String
    Definition Classes
    AnyRef → Any
  213. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  214. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  215. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  216. implicit def writeableOf_AnyContentAsEmpty(implicit code: Codec): Writeable[AnyContentAsEmpty.type]
    Definition Classes
    Writeables
  217. implicit def writeableOf_AnyContentAsFormUrlEncoded(implicit code: Codec): Writeable[AnyContentAsFormUrlEncoded]
    Definition Classes
    Writeables
  218. implicit def writeableOf_AnyContentAsJson: Writeable[AnyContentAsJson]
    Definition Classes
    Writeables
  219. def writeableOf_AnyContentAsJson(codec: Codec, contentType: Option[String] = None): Writeable[AnyContentAsJson]
    Definition Classes
    Writeables
  220. implicit def writeableOf_AnyContentAsMultipartForm(contentType: Option[String])(implicit codec: Codec): Writeable[AnyContentAsMultipartFormData]
    Definition Classes
    Writeables
  221. implicit def writeableOf_AnyContentAsMultipartForm(implicit codec: Codec): Writeable[AnyContentAsMultipartFormData]
    Definition Classes
    Writeables
  222. implicit def writeableOf_AnyContentAsRaw: Writeable[AnyContentAsRaw]
    Definition Classes
    Writeables
  223. implicit def writeableOf_AnyContentAsText(implicit code: Codec): Writeable[AnyContentAsText]
    Definition Classes
    Writeables
  224. implicit def writeableOf_AnyContentAsXml(implicit codec: Codec): Writeable[AnyContentAsXml]
    Definition Classes
    Writeables

Deprecated Value Members

  1. val TOO_MANY_REQUEST: Int
    Definition Classes
    Status
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Use TOO_MANY_REQUESTS instead

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