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.
Content-Type of binary data.
Content-Type of binary data.
Content-Type of application cache.
Content-Type of application cache.
Content-Type of css.
Content-Type of css.
Content-Type of server sent events.
Content-Type of server sent events.
Content-Type of form-urlencoded.
Content-Type of form-urlencoded.
Content-Type of html.
Content-Type of html.
Content-Type of javascript.
Content-Type of javascript.
Content-Type of json.
Content-Type of json.
Content-Type of text.
Content-Type of text.
Content-Type of xml.
Content-Type of xml.
Content-Type of xml.
Content-Type of xml.
Block until a Promise is redeemed with the specified timeout.
Block until a Promise is redeemed with the specified timeout.
Block until a Promise is redeemed.
Block until a Promise is redeemed.
The base builder used in the running method.
The base builder used in the running method.
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.
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.
Extracts the Charset of this Result value.
Extracts the Charset of this Result value.
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 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 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 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 Result value.
Extracts the Content-Type of this Result value.
Extracts the Content-Type of this Content value.
Extracts the Content-Type of this Content value.
Extracts the Cookies set by this Result value.
Extracts the Cookies set by this Result value.
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.
The default await timeout.
The default await timeout. Override this to change it.
Extracts the Flash values set by this Result value.
Extracts the Flash values set by this Result value.
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 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.
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.
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.
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.
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.
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.
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.
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.
Executes a block of code in a running server.
Executes a block of code in a running server.
Executes a block of code in a running application.
Executes a block of code in a running application.
Extracts the Session set by this Result value.
Extracts the Session set by this Result value.
Extracts the Session values set by this Result value.
Extracts the Session values set by this Result value.
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.
Extracts the Status code of this Result value.
Extracts the Status code of 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.
Stub method that returns the content immediately. Useful for unit testing.
val stubParser = bodyParser(AnyContent("hello"))
the content to return, AnyContentAsEmpty by default
a BodyParser for type T that returns Accumulator.done(Right(content))
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")))
the body parser used to parse any content, stubBodyParser(AnyContentAsEmpty) by default.
the playbodyparsers, defaults to stubPlayBodyParsers(NoMaterializer)
the langs instance for messaging, new DefaultLangs() by default.
the mime type associated with file extensions, new DefaultFileMimeTypes(FileMimeTypesConfiguration() by default.
an execution context, defaults to ExecutionContext.global
a fully configured ControllerComponents instance.
default as Seq(Lang.defaultLang).
a stub Langs
Stub method that returns a play.api.i18n.Messages instance.
Stub method that returns a play.api.i18n.Messages instance.
the messagesApi to use, uses stubMessagesApi by default.
the request to use, FakeRequest by default.
the Messages instance
Returns a stub DefaultMessagesApi with default values and an empty map.
Returns a stub DefaultMessagesApi with default values and an empty map.
map of languages to map of messages, empty by default.
stubLangs() by default
"PLAY_LANG" by default
false by default
false by default
configuration, HttpConfiguration() by default.
the messagesApi with minimal configuration.
Stub method that returns a play.api.mvc.MessagesRequest instance.
Stub method that returns a play.api.mvc.MessagesRequest instance.
the messagesApi to use, uses stubMessagesApi by default.
the request to use, FakeRequest by default.
the Messages instance
Stub method for unit testing, using NoTemporaryFileCreator.
Stub method for unit testing, using NoTemporaryFileCreator.
the input materializer.
a minimal PlayBodyParsers for unit testing.
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
(Since version 2.6.0) Use TOO_MANY_REQUESTS instead