Class MockitoService
java.lang.Object
org.jvnet.testing.hk2mockito.internal.MockitoService
A helper service for creating SUT, SC, MC or regular service.
- Author:
- Sharmarke Aden
-
Method Summary
Modifier and TypeMethodDescriptioncreateOrFindService(Injectee injectee, ServiceHandle<?> root) Given an injectee create and cache or resolve the service associated with it.findOrCreateCollaborator(int position, String fieldName, Injectee injectee, ServiceHandle<?> root) Given metadata about collaborator and an injectee create or resolve the collaborating service.findOrCreateSUT(Injectee injectee, ServiceHandle<?> root) Given an SUT annotation and an injectee resolve the service associated with the injectee and use the metadata in the SUT annotation to possibly create a mockito spy.
-
Method Details
-
findOrCreateSUT
Given an SUT annotation and an injectee resolve the service associated with the injectee and use the metadata in the SUT annotation to possibly create a mockito spy.- Parameters:
injectee- The injection point this value is being injected intoroot- The service handle of the root class being created- Returns:
- the service or a proxy spy of the service
-
createOrFindService
Given an injectee create and cache or resolve the service associated with it.- Parameters:
injectee- The injection point this value is being injected intoroot- The service handle of the root class being created- Returns:
- the service or a proxy spy or mock of the service
-
findOrCreateCollaborator
public Object findOrCreateCollaborator(int position, String fieldName, Injectee injectee, ServiceHandle<?> root) Given metadata about collaborator and an injectee create or resolve the collaborating service.- Parameters:
position- method or constructor the parameter position metadatafieldName- field name metadatainjectee- The injection point this value is being injected intoroot- The service handle of the root class being created- Returns:
- the service or a proxy spy or mock of the service
-