StubBodyParserFactory

play.api.test.StubBodyParserFactory

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

def stubBodyParser[T](content: T): BodyParser[T]

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))