Annotation Type InjectMock


  • @Target(FIELD)
    @Retention(RUNTIME)
    public @interface InjectMock
    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 convertScopes
      If true, then Quarkus will change the scope of the target Singleton bean to ApplicationScoped to make the mockable.
      boolean returnsDeepMocks
      If true, the mock will be created with the Mockito.RETURNS_DEEP_STUBS
    • Element Detail

      • convertScopes

        boolean convertScopes
        If true, then Quarkus will change the scope of the target Singleton bean to ApplicationScoped to make the 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