Package io.quarkus.test.junit.mockito
Annotation Type InjectSpy
-
@Target(FIELD) @Retention(RUNTIME) public @interface InjectSpy
When used on a field of a test class, the field becomes a Mockito spy, that is then used to spy on the normal scoped bean which the field represents
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanconvertScopesIf true, then Quarkus will change the scope of the targetSingletonbean toApplicationScoped.booleandelegatetruewill create a mock that delegates all calls to the real bean, instead of creating a regular Mockito spy.
-
-
-
Element Detail
-
delegate
boolean delegate
truewill create a mock that delegates all calls to the real bean, instead of creating a regular Mockito spy. You should try this mode when you get errors like "Cannot call abstract real method on java object!" when calling adefaultinterface method of a spied bean.- See Also:
AdditionalAnswers.delegatesTo(Object)
- Default:
- false
-
-
-
convertScopes
boolean convertScopes
If true, then Quarkus will change the scope of the targetSingletonbean toApplicationScoped. This is an advanced setting and should only be used if you don't rely on the differences betweenSingletonandApplicationScopedbeans (for example it is invalid to read fields ofApplicationScopedbeans as a proxy stands in place of the actual implementation)- Default:
- false
-
-