Annotation Interface InjectMock


@Deprecated(since="3.2", forRemoval=true) @Target(FIELD) @Retention(RUNTIME) public @interface InjectMock
Deprecated, for removal: This API element is subject to removal in a future version.
Use InjectMock and MockitoConfig instead.
When used on a field of a test class, the field becomes a Mockito mock, that is then used to mock the normal scoped bean which the field represents.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    If true, then Quarkus will change the scope of the target Singleton bean to ApplicationScoped to make it mockable.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    If true, the mock will be created with the Mockito.RETURNS_DEEP_STUBS
  • Element Details

    • convertScopes

      boolean convertScopes
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
      Deprecated, for removal: This API element is subject to removal in a future version.
      If true, the mock will be created with the Mockito.RETURNS_DEEP_STUBS
      Default:
      false