Trait

play.api.test

StubControllerComponentsFactory

Related Doc: package test

Permalink

trait StubControllerComponentsFactory extends StubPlayBodyParsersFactory with StubBodyParserFactory

Source
Helpers.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StubControllerComponentsFactory
  2. StubBodyParserFactory
  3. StubPlayBodyParsersFactory
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  15. 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
  16. def stubControllerComponents(bodyParser: BodyParser[AnyContent] = stubBodyParser(AnyContentAsEmpty), playBodyParsers: PlayBodyParsers = stubPlayBodyParsers(NoMaterializer), messagesApi: MessagesApi = new DefaultMessagesApi(), langs: Langs = new DefaultLangs(), fileMimeTypes: FileMimeTypes = ..., executionContent: 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.

    executionContent

    an execution context, defaults to ExecutionContext.global

    returns

    a fully configured ControllerComponents instance.

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

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StubBodyParserFactory

Inherited from AnyRef

Inherited from Any

Ungrouped