Relative Content

Tag Archive for javamockito

Javax Inject Not Working for InjectingMocks

I’m trying to test a service that injects its dependencies with @Inject. But for some reason I can’t use InjectMocks for other dependencias inside the test. My service Example:

Different kinds of mock objects

I observed a strange phenomenon. mockito creates different kinds of mocks objects: in one project, the mock objects are simply nulls, in another project, the mock objects are empty objects with nulls as values for their properties.