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.
Stub method for unit testing, using NoTemporaryFileCreator.
Stub method for unit testing, using NoTemporaryFileCreator.
the input materializer.
a minimal PlayBodyParsers for unit testing.