The method I need to test is the public method:
Public Responseresult Subscribe (syssubscription syssubscription) throws Jsongenerationexception, Jsonmappingexception, IOException {
Logger.debug ("=====================subscribe subscription=======================");
Responseresult result = new Responseresult ();
if (Checknotnull (syssubscription)) {
Return Handlesubscribe (syssubscription, result);
}
return result;
}
However, the private method is called inside Handlesubscribe:
Private Responseresult Createresponseresultbyresponse (Response Response, Responseresult responseresult) {
Try Powermockito Spy to partially mock private method found useless. Because this is a two-tier public method.
Had to change the method to
protected Responseresult Createresponseresultbyresponse (Response Response, Responseresult responseresult) {
Powermockito "The problem of private methods inside the mock public method"