@Retention(RUNTIME) @Target({FIELD,PARAMETER}) public @interface MockBean
A field annotated with @MockBean will be mocked by Mockito and injected in every place it is referenced.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    org.mockito.Answers
    The Answers type to use on the mock.
  • Element Details

    • answer

      org.mockito.Answers answer
      The Answers type to use on the mock. Defaults to Answers.RETURNS_DEFAULTS
      Returns:
      the answer type
      Default:
      RETURNS_DEFAULTS