I have created a Junit test case in an existing class where I want to ignore few mocks
@InjectMock
private HomeService homeService;
@Mock
private HomeUtility homeUtility;
@Test
public void testIsFilterWorkedTrue() {
homeService.getData();
}
HomeService.java
class HomeService {
@Autowired
private HomeUtility homeUtility;
public [RETURN_TYPE] getData() {
// call mocked method
output = mockedMethodcall();
test = homeUtility.callMethod(output);
return test;
}
}
In the above code, for homeUtility.callMethod(output);, I don't want it to be mocked and should go inside the method. I have to use
@Mock
private HomeUtility homeUtility;
because it is getting used in other methods as well. How can I ignore it