Package io.quarkus.test.junit.mockito
Annotation 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 ElementsModifier and TypeOptional ElementDescriptionbooleanIf true, then Quarkus will change the scope of the targetSingletonbean toApplicationScoped.booleantruewill create a mock that delegates all calls to the real bean, instead of creating a regular Mockito spy.
-
Element Details
-
delegate
boolean delegatetruewill 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:
- Default:
false
-
convertScopes
boolean convertScopesIf 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
-