@Component
Class A{
public String method1(){
ClassB bObject = new ClassB();
bObject.makeHTTPCallAndConvertResponseToJSONString();
}
}
Class ATest{
@InjectMocks
ClassA aObject;
public String testMethod1(){
// how to test aObject.method1();
// I want to mock new bObject that is created
}
}
Need to mock the bObject that is getting created. Want to know if this is possible. Looked through all the relative questions on the same topic but couldn't find any. Is this a limitation of Mockito?