Annotation Interface MockitoConfig


@Target(FIELD) @Retention(RUNTIME) public @interface MockitoConfig
This annotation can be used to configure a Mockito mock injected in a field of a test class that is annotated with InjectMock. This annotation is only supported in a io.quarkus.test.QuarkusTest.
See Also:
  • InjectMock
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, then Quarkus will change the scope of the target Singleton bean to ApplicationScoped to make it mockable.
    boolean
    If true, the mock will be created with the Mockito.RETURNS_DEEP_STUBS
  • Element Details

    • convertScopes

      boolean convertScopes
      If true, then Quarkus will change the scope of the target Singleton bean to ApplicationScoped to make it mockable.

      This is an advanced setting and should only be used if you don't rely on the differences between Singleton and ApplicationScoped beans (for example it is invalid to read fields of ApplicationScoped beans as a proxy stands in place of the actual implementation)

      Default:
      false
    • returnsDeepMocks

      boolean returnsDeepMocks
      If true, the mock will be created with the Mockito.RETURNS_DEEP_STUBS
      Default:
      false