https://stackoverflow.com/questions/36173947/mockito-mock-private-field-initialization
In case you use Spring Test try org.springframework.test.util.ReflectionTestUtils
ReflectionTestUtils.setField(testObject, "person", mockedPerson);
No comments:
Post a Comment