So I understand that in Mockito @InjectMocks will inject anything that it can with the annotation of @Mock, but how to handle this scenario?
@Mock private MockOb
This works for me:
private MockObject1 mockObject1 = mock(MockObject1.class); @Spy private RealObject2 realObject = new RealObject2(mockObject1); @InjectMocks private SystemUnderTest systemUnderTest = new SystemUnderTest();