Object

play.api.test

Helpers

Related Doc: package test

Permalink

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

Source
Helpers.scala
Linear Supertypes
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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val ACCEPT: String

    Permalink
    Definition Classes
    HeaderNames
  5. val ACCEPTED: Int

    Permalink
    Definition Classes
    Status
  6. val ACCEPT_CHARSET: String

    Permalink
    Definition Classes
    HeaderNames
  7. val ACCEPT_ENCODING: String

    Permalink
    Definition Classes
    HeaderNames
  8. val ACCEPT_LANGUAGE: String

    Permalink
    Definition Classes
    HeaderNames
  9. val ACCEPT_RANGES: String

    Permalink
    Definition Classes
    HeaderNames
  10. val ACCESS_CONTROL_ALLOW_CREDENTIALS: String

    Permalink
    Definition Classes
    HeaderNames
  11. val ACCESS_CONTROL_ALLOW_HEADERS: String

    Permalink
    Definition Classes
    HeaderNames
  12. val ACCESS_CONTROL_ALLOW_METHODS: String

    Permalink
    Definition Classes
    HeaderNames
  13. val ACCESS_CONTROL_ALLOW_ORIGIN: String

    Permalink
    Definition Classes
    HeaderNames
  14. val ACCESS_CONTROL_EXPOSE_HEADERS: String

    Permalink
    Definition Classes
    HeaderNames
  15. val ACCESS_CONTROL_MAX_AGE: String

    Permalink
    Definition Classes
    HeaderNames
  16. val ACCESS_CONTROL_REQUEST_HEADERS: String

    Permalink
    Definition Classes
    HeaderNames
  17. val ACCESS_CONTROL_REQUEST_METHOD: String

    Permalink
    Definition Classes
    HeaderNames
  18. val AGE: String

    Permalink
    Definition Classes
    HeaderNames
  19. val ALLOW: String

    Permalink
    Definition Classes
    HeaderNames
  20. val AUTHORIZATION: String

    Permalink
    Definition Classes
    HeaderNames
  21. val BAD_GATEWAY: Int

    Permalink
    Definition Classes
    Status
  22. val BAD_REQUEST: Int

    Permalink
    Definition Classes
    Status
  23. val BINARY: String

    Permalink

    Content-Type of binary data.

    Content-Type of binary data.

    Definition Classes
    MimeTypes
  24. val CACHE_CONTROL: String

    Permalink
    Definition Classes
    HeaderNames
  25. val CACHE_MANIFEST: String

    Permalink

    Content-Type of application cache.

    Content-Type of application cache.

    Definition Classes
    MimeTypes
  26. val CHUNKED: String

    Permalink
    Definition Classes
    HttpProtocol
  27. val CONFLICT: Int

    Permalink
    Definition Classes
    Status
  28. val CONNECTION: String

    Permalink
    Definition Classes
    HeaderNames
  29. val CONTENT_DISPOSITION: String

    Permalink
    Definition Classes
    HeaderNames
  30. val CONTENT_ENCODING: String

    Permalink
    Definition Classes
    HeaderNames
  31. val CONTENT_LANGUAGE: String

    Permalink
    Definition Classes
    HeaderNames
  32. val CONTENT_LENGTH: String

    Permalink
    Definition Classes
    HeaderNames
  33. val CONTENT_LOCATION: String

    Permalink
    Definition Classes
    HeaderNames
  34. val CONTENT_MD5: String

    Permalink
    Definition Classes
    HeaderNames
  35. val CONTENT_RANGE: String

    Permalink
    Definition Classes
    HeaderNames
  36. val CONTENT_TRANSFER_ENCODING: String

    Permalink
    Definition Classes
    HeaderNames
  37. val CONTENT_TYPE: String

    Permalink
    Definition Classes
    HeaderNames
  38. val CONTINUE: Int

    Permalink
    Definition Classes
    Status
  39. val COOKIE: String

    Permalink
    Definition Classes
    HeaderNames
  40. val CREATED: Int

    Permalink
    Definition Classes
    Status
  41. val CSS: String

    Permalink

    Content-Type of css.

    Content-Type of css.

    Definition Classes
    MimeTypes
  42. val DATE: String

    Permalink
    Definition Classes
    HeaderNames
  43. val DELETE: String

    Permalink
    Definition Classes
    HttpVerbs
  44. val ETAG: String

    Permalink
    Definition Classes
    HeaderNames
  45. val EVENT_STREAM: String

    Permalink

    Content-Type of server sent events.

    Content-Type of server sent events.

    Definition Classes
    MimeTypes
  46. val EXPECT: String

    Permalink
    Definition Classes
    HeaderNames
  47. val EXPECTATION_FAILED: Int

    Permalink
    Definition Classes
    Status
  48. val EXPIRES: String

    Permalink
    Definition Classes
    HeaderNames
  49. val FAILED_DEPENDENCY: Int

    Permalink
    Definition Classes
    Status
  50. val FIREFOX: Class[FirefoxDriver]

    Permalink
    Definition Classes
    PlayRunners
  51. val FORBIDDEN: Int

    Permalink
    Definition Classes
    Status
  52. val FORM: String

    Permalink

    Content-Type of form-urlencoded.

    Content-Type of form-urlencoded.

    Definition Classes
    MimeTypes
  53. val FORWARDED: String

    Permalink
    Definition Classes
    HeaderNames
  54. val FOUND: Int

    Permalink
    Definition Classes
    Status
  55. val FROM: String

    Permalink
    Definition Classes
    HeaderNames
  56. val GATEWAY_TIMEOUT: Int

    Permalink
    Definition Classes
    Status
  57. val GET: String

    Permalink
    Definition Classes
    HttpVerbs
  58. val GONE: Int

    Permalink
    Definition Classes
    Status
  59. val HEAD: String

    Permalink
    Definition Classes
    HttpVerbs
  60. val HOST: String

    Permalink
    Definition Classes
    HeaderNames
  61. val HTML: String

    Permalink

    Content-Type of html.

    Content-Type of html.

    Definition Classes
    MimeTypes
  62. val HTMLUNIT: Class[HtmlUnitDriver]

    Permalink
    Definition Classes
    PlayRunners
  63. val HTTP_1_0: String

    Permalink
    Definition Classes
    HttpProtocol
  64. val HTTP_1_1: String

    Permalink
    Definition Classes
    HttpProtocol
  65. val HTTP_VERSION_NOT_SUPPORTED: Int

    Permalink
    Definition Classes
    Status
  66. val IF_MATCH: String

    Permalink
    Definition Classes
    HeaderNames
  67. val IF_MODIFIED_SINCE: String

    Permalink
    Definition Classes
    HeaderNames
  68. val IF_NONE_MATCH: String

    Permalink
    Definition Classes
    HeaderNames
  69. val IF_RANGE: String

    Permalink
    Definition Classes
    HeaderNames
  70. val IF_UNMODIFIED_SINCE: String

    Permalink
    Definition Classes
    HeaderNames
  71. val IM_A_TEAPOT: Int

    Permalink
    Definition Classes
    Status
  72. val INSUFFICIENT_STORAGE: Int

    Permalink
    Definition Classes
    Status
  73. val INTERNAL_SERVER_ERROR: Int

    Permalink
    Definition Classes
    Status
  74. val JAVASCRIPT: String

    Permalink

    Content-Type of javascript.

    Content-Type of javascript.

    Definition Classes
    MimeTypes
  75. val JSON: String

    Permalink

    Content-Type of json.

    Content-Type of json.

    Definition Classes
    MimeTypes
  76. val LAST_MODIFIED: String

    Permalink
    Definition Classes
    HeaderNames
  77. val LENGTH_REQUIRED: Int

    Permalink
    Definition Classes
    Status
  78. val LINK: String

    Permalink
    Definition Classes
    HeaderNames
  79. val LOCATION: String

    Permalink
    Definition Classes
    HeaderNames
  80. val LOCKED: Int

    Permalink
    Definition Classes
    Status
  81. val MAX_FORWARDS: String

    Permalink
    Definition Classes
    HeaderNames
  82. val METHOD_NOT_ALLOWED: Int

    Permalink
    Definition Classes
    Status
  83. val MOVED_PERMANENTLY: Int

    Permalink
    Definition Classes
    Status
  84. val MULTIPLE_CHOICES: Int

    Permalink
    Definition Classes
    Status
  85. val MULTI_STATUS: Int

    Permalink
    Definition Classes
    Status
  86. val NON_AUTHORITATIVE_INFORMATION: Int

    Permalink
    Definition Classes
    Status
  87. val NOT_ACCEPTABLE: Int

    Permalink
    Definition Classes
    Status
  88. val NOT_FOUND: Int

    Permalink
    Definition Classes
    Status
  89. val NOT_IMPLEMENTED: Int

    Permalink
    Definition Classes
    Status
  90. val NOT_MODIFIED: Int

    Permalink
    Definition Classes
    Status
  91. val NO_CONTENT: Int

    Permalink
    Definition Classes
    Status
  92. val OK: Int

    Permalink
    Definition Classes
    Status
  93. val OPTIONS: String

    Permalink
    Definition Classes
    HttpVerbs
  94. val ORIGIN: String

    Permalink
    Definition Classes
    HeaderNames
  95. val PARTIAL_CONTENT: Int

    Permalink
    Definition Classes
    Status
  96. val PATCH: String

    Permalink
    Definition Classes
    HttpVerbs
  97. val PAYMENT_REQUIRED: Int

    Permalink
    Definition Classes
    Status
  98. val PERMANENT_REDIRECT: Int

    Permalink
    Definition Classes
    Status
  99. val POST: String

    Permalink
    Definition Classes
    HttpVerbs
  100. val PRAGMA: String

    Permalink
    Definition Classes
    HeaderNames
  101. val PRECONDITION_FAILED: Int

    Permalink
    Definition Classes
    Status
  102. val PROXY_AUTHENTICATE: String

    Permalink
    Definition Classes
    HeaderNames
  103. val PROXY_AUTHENTICATION_REQUIRED: Int

    Permalink
    Definition Classes
    Status
  104. val PROXY_AUTHORIZATION: String

    Permalink
    Definition Classes
    HeaderNames
  105. val PUT: String

    Permalink
    Definition Classes
    HttpVerbs
  106. val RANGE: String

    Permalink
    Definition Classes
    HeaderNames
  107. val REFERER: String

    Permalink
    Definition Classes
    HeaderNames
  108. val REQUESTED_RANGE_NOT_SATISFIABLE: Int

    Permalink
    Definition Classes
    Status
  109. val REQUEST_ENTITY_TOO_LARGE: Int

    Permalink
    Definition Classes
    Status
  110. val REQUEST_TIMEOUT: Int

    Permalink
    Definition Classes
    Status
  111. val REQUEST_URI_TOO_LONG: Int

    Permalink
    Definition Classes
    Status
  112. val RESET_CONTENT: Int

    Permalink
    Definition Classes
    Status
  113. val RETRY_AFTER: String

    Permalink
    Definition Classes
    HeaderNames
  114. val SEE_OTHER: Int

    Permalink
    Definition Classes
    Status
  115. val SERVER: String

    Permalink
    Definition Classes
    HeaderNames
  116. val SERVICE_UNAVAILABLE: Int

    Permalink
    Definition Classes
    Status
  117. val SET_COOKIE: String

    Permalink
    Definition Classes
    HeaderNames
  118. val SET_COOKIE2: String

    Permalink
    Definition Classes
    HeaderNames
  119. val STRICT_TRANSPORT_SECURITY: String

    Permalink
    Definition Classes
    HeaderNames
  120. val SWITCHING_PROTOCOLS: Int

    Permalink
    Definition Classes
    Status
  121. val TE: String

    Permalink
    Definition Classes
    HeaderNames
  122. val TEMPORARY_REDIRECT: Int

    Permalink
    Definition Classes
    Status
  123. val TEXT: String

    Permalink

    Content-Type of text.

    Content-Type of text.

    Definition Classes
    MimeTypes
  124. val TOO_MANY_REQUESTS: Int

    Permalink
    Definition Classes
    Status
  125. val TRAILER: String

    Permalink
    Definition Classes
    HeaderNames
  126. val TRANSFER_ENCODING: String

    Permalink
    Definition Classes
    HeaderNames
  127. val UNAUTHORIZED: Int

    Permalink
    Definition Classes
    Status
  128. val UNPROCESSABLE_ENTITY: Int

    Permalink
    Definition Classes
    Status
  129. val UNSUPPORTED_MEDIA_TYPE: Int

    Permalink
    Definition Classes
    Status
  130. val UPGRADE: String

    Permalink
    Definition Classes
    HeaderNames
  131. val UPGRADE_REQUIRED: Int

    Permalink
    Definition Classes
    Status
  132. val USER_AGENT: String

    Permalink
    Definition Classes
    HeaderNames
  133. val USE_PROXY: Int

    Permalink
    Definition Classes
    Status
  134. val VARY: String

    Permalink
    Definition Classes
    HeaderNames
  135. val VIA: String

    Permalink
    Definition Classes
    HeaderNames
  136. val WARNING: String

    Permalink
    Definition Classes
    HeaderNames
  137. val WWW_AUTHENTICATE: String

    Permalink
    Definition Classes
    HeaderNames
  138. val XHTML: String

    Permalink

    Content-Type of xml.

    Content-Type of xml.

    Definition Classes
    MimeTypes
  139. val XML: String

    Permalink

    Content-Type of xml.

    Content-Type of xml.

    Definition Classes
    MimeTypes
  140. val X_FORWARDED_FOR: String

    Permalink
    Definition Classes
    HeaderNames
  141. val X_FORWARDED_HOST: String

    Permalink
    Definition Classes
    HeaderNames
  142. val X_FORWARDED_PORT: String

    Permalink
    Definition Classes
    HeaderNames
  143. val X_FORWARDED_PROTO: String

    Permalink
    Definition Classes
    HeaderNames
  144. val X_REQUESTED_WITH: String

    Permalink
    Definition Classes
    HeaderNames
  145. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  146. def await[T](future: Future[T], timeout: Long, unit: TimeUnit): T

    Permalink

    Block until a Promise is redeemed with the specified timeout.

    Block until a Promise is redeemed with the specified timeout.

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

    Permalink

    Block until a Promise is redeemed.

    Block until a Promise is redeemed.

    Definition Classes
    FutureAwaits
  148. lazy val baseApplicationBuilder: GuiceApplicationBuilder

    Permalink

    The base builder used in the running method.

    The base builder used in the running method.

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

    Permalink

    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
  150. def call[T](action: EssentialAction, req: Request[T])(implicit w: Writeable[T], mat: Materializer): Future[Result]

    Permalink

    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 charset(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Option[String]

    Permalink

    Extracts the Charset of this Result value.

    Extracts the Charset of this Result value.

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

    Permalink

    Extracts the Charset of this Result value.

    Extracts the Charset of this Result value.

    Definition Classes
    ResultExtractors
  153. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  154. def contentAsBytes(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): ByteString

    Permalink

    Extracts the content as bytes.

    Extracts the content as bytes.

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

    Permalink

    Extracts the content as bytes.

    Extracts the content as bytes.

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

    Permalink

    Extracts the content as bytes.

    Extracts the content as bytes.

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

    Permalink

    Extracts the content as Json.

    Extracts the content as Json.

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

    Permalink

    Extracts the content as Json.

    Extracts the content as Json.

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

    Permalink

    Extracts the content as Json.

    Extracts the content as Json.

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

    Permalink

    Extracts the content as String.

    Extracts the content as String.

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

    Permalink

    Extracts the content as String.

    Extracts the content as String.

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

    Permalink

    Extracts the content as String.

    Extracts the content as String.

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

    Permalink

    Extracts the Content-Type of this Result value.

    Extracts the Content-Type of this Result value.

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

    Permalink

    Extracts the Content-Type of this Result value.

    Extracts the Content-Type of this Result value.

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

    Permalink

    Extracts the Content-Type of this Content value.

    Extracts the Content-Type of this Content value.

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

    Permalink

    Extracts the Cookies set by this Result value.

    Extracts the Cookies set by this Result value.

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

    Permalink

    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
  168. implicit def defaultAwaitTimeout: Timeout

    Permalink

    The default await timeout.

    The default await timeout. Override this to change it.

    Definition Classes
    DefaultAwaitTimeout
  169. implicit val defaultNegativeTimeout: NegativeTimeout

    Permalink
    Definition Classes
    DefaultAwaitTimeout
  170. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  171. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  172. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  173. def flash(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Flash

    Permalink

    Extracts the Flash values set by this Result value.

    Extracts the Flash values set by this Result value.

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

    Permalink

    Extracts the Flash values set by this Result value.

    Extracts the Flash values set by this Result value.

    Definition Classes
    ResultExtractors
  175. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  176. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  177. def header(header: String, of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Option[String]

    Permalink

    Extracts an Header value of this Result value.

    Extracts an Header value of this Result value.

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

    Permalink

    Extracts an Header value of this Result value.

    Extracts an Header value of this Result value.

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

    Permalink

    Extracts all Headers of this Result value.

    Extracts all Headers of this Result value.

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

    Permalink

    Extracts all Headers of this Result value.

    Extracts all Headers of this Result value.

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

    Permalink

    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
  182. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  183. def jRoute[T](app: Application, r: RequestHeader, body: RequestBody): Option[Future[Result]]

    Permalink
    Definition Classes
    RouteInvokers
  184. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  185. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  186. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  187. def redirectLocation(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Option[String]

    Permalink

    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
  188. def redirectLocation(of: Future[Result])(implicit timeout: Timeout): Option[String]

    Permalink

    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 route[T](app: Application, req: Request[T])(implicit w: Writeable[T]): Option[Future[Result]]

    Permalink

    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
  190. def route[T](app: Application, rh: RequestHeader, body: T)(implicit w: Writeable[T]): Option[Future[Result]]

    Permalink

    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 running[T](testServer: TestServer, webDriver: WebDriver)(block: (TestBrowser) ⇒ T): T

    Permalink

    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
  192. def running[T, WEBDRIVER <: WebDriver](testServer: TestServer, webDriver: Class[WEBDRIVER])(block: (TestBrowser) ⇒ T): T

    Permalink

    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](testServer: TestServer)(block: ⇒ T): T

    Permalink

    Executes a block of code in a running server.

    Executes a block of code in a running server.

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

    Permalink
    Definition Classes
    PlayRunners
  195. def running[T](app: Application)(block: ⇒ T): T

    Permalink

    Executes a block of code in a running application.

    Executes a block of code in a running application.

    Definition Classes
    PlayRunners
  196. def running[T]()(block: (Application) ⇒ T): T

    Permalink
    Definition Classes
    PlayRunners
  197. def session(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Session

    Permalink

    Extracts the Session set by this Result value.

    Extracts the Session set by this Result value.

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

    Permalink

    Extracts the Session values set by this Result value.

    Extracts the Session values set by this Result value.

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

    Permalink

    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
  200. def status(of: Accumulator[ByteString, Result])(implicit timeout: Timeout, mat: Materializer): Int

    Permalink

    Extracts the Status code of this Result value.

    Extracts the Status code of this Result value.

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

    Permalink

    Extracts the Status code of this Result value.

    Extracts the Status code of this Result value.

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

    Permalink

    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
  203. def stubControllerComponents(bodyParser: BodyParser[AnyContent] = stubBodyParser(AnyContentAsEmpty), playBodyParsers: PlayBodyParsers = stubPlayBodyParsers(NoMaterializer), messagesApi: MessagesApi = stubMessagesApi(), langs: Langs = stubLangs(), fileMimeTypes: FileMimeTypes = ..., executionContext: ExecutionContext = ExecutionContext.global): ControllerComponents

    Permalink

    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
  204. def stubLangs(availables: Seq[Lang] = Seq(Lang.defaultLang)): Langs

    Permalink

    availables

    default as Seq(Lang.defaultLang).

    returns

    a stub Langs

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

    Permalink

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

    Permalink

    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
  207. def stubMessagesRequest(messagesApi: MessagesApi = stubMessagesApi(), request: Request[AnyContentAsEmpty.type] = FakeRequest()): MessagesRequest[AnyContentAsEmpty.type]

    Permalink

    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
  208. def stubPlayBodyParsers(implicit mat: Materializer): PlayBodyParsers

    Permalink

    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
  209. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  210. lazy val testServerPort: Int

    Permalink

    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
  211. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  212. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  213. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  214. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  215. implicit def writeableOf_AnyContentAsEmpty(implicit code: Codec): Writeable[AnyContentAsEmpty.type]

    Permalink
    Definition Classes
    Writeables
  216. implicit def writeableOf_AnyContentAsFormUrlEncoded(implicit code: Codec): Writeable[AnyContentAsFormUrlEncoded]

    Permalink
    Definition Classes
    Writeables
  217. implicit def writeableOf_AnyContentAsJson: Writeable[AnyContentAsJson]

    Permalink
    Definition Classes
    Writeables
  218. def writeableOf_AnyContentAsJson(codec: Codec, contentType: Option[String] = None): Writeable[AnyContentAsJson]

    Permalink
    Definition Classes
    Writeables
  219. implicit def writeableOf_AnyContentAsMultipartForm(contentType: Option[String])(implicit codec: Codec): Writeable[AnyContentAsMultipartFormData]

    Permalink
    Definition Classes
    Writeables
  220. implicit def writeableOf_AnyContentAsMultipartForm(implicit codec: Codec): Writeable[AnyContentAsMultipartFormData]

    Permalink
    Definition Classes
    Writeables
  221. implicit def writeableOf_AnyContentAsRaw: Writeable[AnyContentAsRaw]

    Permalink
    Definition Classes
    Writeables
  222. implicit def writeableOf_AnyContentAsText(implicit code: Codec): Writeable[AnyContentAsText]

    Permalink
    Definition Classes
    Writeables
  223. implicit def writeableOf_AnyContentAsXml(implicit codec: Codec): Writeable[AnyContentAsXml]

    Permalink
    Definition Classes
    Writeables

Deprecated Value Members

  1. val TOO_MANY_REQUEST: Int

    Permalink
    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