Helpers
Attributes
- Graph
-
- Supertypes
-
trait StubMessagesFactorytrait StubBodyParserFactorytrait FutureAwaitstrait RouteInvokerstrait EssentialActionCallertrait Writeablestrait ResultExtractorstrait DefaultAwaitTimeouttrait HttpProtocoltrait MimeTypestrait Statustrait HeaderNamestrait PlayRunnerstrait HttpVerbsclass Objecttrait Matchableclass AnyShow all
- Self type
-
Helpers.type
Members list
Type members
Inherited classlikes
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.
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.
Attributes
- Inherited from:
- DefaultAwaitTimeout
- Supertypes
Value members
Inherited methods
Block until a Promise is redeemed with the specified timeout.
Block until a Promise is redeemed with the specified timeout.
Attributes
- Inherited from:
- FutureAwaits
Block until a Promise is redeemed.
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.
Attributes
- Inherited from:
- EssentialActionCaller
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.
Attributes
- Inherited from:
- EssentialActionCaller
Extracts the Charset of this Result value.
Extracts the Charset of this Result value.
Extracts the content as bytes.
Extracts the content as bytes.
Extracts the content as bytes.
Extracts the content as Json.
Extracts the content as Json.
Extracts the content as Json.
Extracts the content as String.
Extracts the content as String.
Extracts the content as String.
Extracts the Content-Type of this Result value.
Extracts the Content-Type of this Result value.
Extracts the Content-Type of this Content value.
Extracts the Cookies set by 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.
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.
Attributes
- Inherited from:
- ResultExtractors
Extracts the Flash values set by this Result value.
Extracts the Flash values set by this Result value.
Extracts an Header value of this Result value.
Extracts an Header value of this Result value.
Extracts all Headers of this Result value.
Extracts all Headers of this Result value.
Constructs a in-memory (h2) database configuration to add to an Application.
Constructs a in-memory (h2) database configuration to add to an Application.
Attributes
- Inherited from:
- PlayRunners
Attributes
- Inherited from:
- RouteInvokers
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.
Attributes
- Inherited from:
- ResultExtractors
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.
Attributes
- Inherited from:
- ResultExtractors
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.
Attributes
- Inherited from:
- RouteInvokers
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.
Attributes
- Inherited from:
- RouteInvokers
Use the Router to determine the Action to call for this request and execute it.
Use the Router 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.
Attributes
- Inherited from:
- RouteInvokers
Use the Router to determine the Action to call for this request and execute it.
Use the Router 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.
Attributes
- Inherited from:
- RouteInvokers
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.
Attributes
- Inherited from:
- PlayRunners
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.
Attributes
- Inherited from:
- PlayRunners
Executes a block of code in a running server.
Attributes
- Inherited from:
- PlayRunners
Executes a block of code in a running application.
Attributes
- Inherited from:
- PlayRunners
Executes a block of code in a running server, with a test browser and a port. If available the http port will be used first, before falling back to the https port.
Executes a block of code in a running server, with a test browser and a port. If available the http port will be used first, before falling back to the https port.
Attributes
- Inherited from:
- PlayRunners
Executes a block of code in a running server, with a test browser and a port.
Executes a block of code in a running server, with a test browser and a port.
Attributes
- Inherited from:
- PlayRunners
Executes a block of code in a running server, with a port. If available the http port will be used first, before falling back to the https port.
Executes a block of code in a running server, with a port. If available the http port will be used first, before falling back to the https port.
Attributes
- Inherited from:
- PlayRunners
Extracts the Session set by this Result value.
Extracts the Session values set by this Result value.
Extracts the Status code of this Result value.
Extracts the Status code of this Result value.
Stub method that returns the content immediately. Useful for unit testing.
Stub method that returns the content immediately. Useful for unit testing.
val stubParser = bodyParser(AnyContent("hello"))
Value parameters
- content
-
the content to return, AnyContentAsEmpty by default
Attributes
- Returns
-
a BodyParser for type T that returns Accumulator.done(Right(content))
- Inherited from:
- StubBodyParserFactory
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")))
Value parameters
- bodyParser
-
the body parser used to parse any content, stubBodyParser(AnyContentAsEmpty) by default.
- executionContext
-
an execution context, defaults to ExecutionContext.global
- fileMimeTypes
-
the mime type associated with file extensions, new DefaultFileMimeTypes(FileMimeTypesConfiguration() by default.
- langs
-
the langs instance for messaging, new DefaultLangs() by default.
- messagesApi
-
the messages api, new DefaultMessagesApi() by default.
- playBodyParsers
-
the playbodyparsers, defaults to stubPlayBodyParsers(NoMaterializer)
Attributes
- Returns
-
a fully configured ControllerComponents instance.
- Inherited from:
- StubControllerComponentsFactory
Value parameters
- availables
-
default as Seq(Lang.defaultLang).
Attributes
- Returns
-
a stub Langs
- Inherited from:
- StubMessagesFactory
Stub method that returns a play.api.i18n.Messages instance.
Stub method that returns a play.api.i18n.Messages instance.
Value parameters
- messagesApi
-
the messagesApi to use, uses stubMessagesApi by default.
- requestHeader
-
the request to use, FakeRequest by default.
Attributes
- Returns
-
the Messages instance
- Inherited from:
- StubMessagesFactory
Returns a stub DefaultMessagesApi with default values and an empty map.
Returns a stub DefaultMessagesApi with default values and an empty map.
Value parameters
- httpConfiguration
-
configuration, HttpConfiguration() by default.
- langCookieHttpOnly
-
false by default
- langCookieMaxAge
-
None by default
- langCookieName
-
"PLAY_LANG" by default
- langCookieSameSite
-
None by default
- langCookieSecure
-
false by default
- langs
-
stubLangs() by default
- messages
-
map of languages to map of messages, empty by default.
Attributes
- Returns
-
the messagesApi with minimal configuration.
- Inherited from:
- StubMessagesFactory
Attributes
- Inherited from:
- StubControllerComponentsFactory
Stub method that returns a play.api.mvc.MessagesRequest instance.
Stub method that returns a play.api.mvc.MessagesRequest instance.
Value parameters
- messagesApi
-
the messagesApi to use, uses stubMessagesApi by default.
- request
-
the request to use, FakeRequest by default.
Attributes
- Returns
-
the Messages instance
- Inherited from:
- StubMessagesFactory
Stub method for unit testing, using NoTemporaryFileCreator.
Stub method for unit testing, using NoTemporaryFileCreator.
Value parameters
- mat
-
the input materializer.
Attributes
- Returns
-
a minimal PlayBodyParsers for unit testing.
- Inherited from:
- StubPlayBodyParsersFactory
Attributes
- Inherited from:
- PlayRunners
Attributes
- Inherited from:
- PlayRunners
The port to use for a test server. Defaults to a random port. May be configured using the system property testserver.port
The port to use for a test server. Defaults to a random port. May be configured using the system property testserver.port
Attributes
- Inherited from:
- PlayRunners
Attributes
- Inherited from:
- Writeables
If you pass a boundary, it will be used to separate the data/file parts of the multipart/form-data body. If you don't pass a boundary a random one will be generated.
If you pass a boundary, it will be used to separate the data/file parts of the multipart/form-data body. If you don't pass a boundary a random one will be generated.
Attributes
- Inherited from:
- Writeables
Inherited fields
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Content-Type of binary data.
Attributes
- Inherited from:
- HeaderNames
Content-Type of application cache.
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Content-Type of server sent events.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- PlayRunners
Content-Type of form-urlencoded.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- PlayRunners
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Content-Type of javascript.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Content-Type of xhtml.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
The base builder used in the running method.
Implicits
Inherited implicits
The default await timeout. Override this to change it.
The default await timeout. Override this to change it.
Attributes
- Inherited from:
- DefaultAwaitTimeout
Attributes
- Inherited from:
- DefaultAwaitTimeout
Attributes
- Inherited from:
- Writeables
Attributes
- Inherited from:
- Writeables
Attributes
- Inherited from:
- Writeables
Attributes
- Inherited from:
- Writeables
Attributes
- Inherited from:
- Writeables
Attributes
- Inherited from:
- Writeables
Attributes
- Inherited from:
- Writeables
Deprecated and Inherited implicits
Attributes
- Deprecated
- true
- Inherited from:
- Writeables