I want on one method use mock eventService and in another real eventService.
@Mock(name = "eventService")
private EventService eventService;
@InjectMocks
private CandidateMenuController candidateMenuController = new CandidateMenuController();
How to write analog this code inside method.
I have CandidateMenuController candidateMenuController as class field. But at one method I want to use specific eventService realization.
P.S I have not constructor and set get method for EventService
CandidateMenuControllerobjects, one with@InjectMocksand one without; then use whichever object is appropriate for each test?@InjectMocksto be selective about which fields to inject.