I am using powermock. I am facing issues with below scenario.
UPDATE:
My Question is different. The example given in another link, has private method returning some value. Here in my case both the methods are returning Void.
class ClassForWhichTestCasesIsPrepared {
private void myPrivateMethod(String param1, MyBean param2) {
//Some Code Here to save data
}
public void myPublicMethod() {
//Some Code Here to find the require paramters to pass to below method
myPrivateMethod(String param1, MyBean param2);
}
}
Facing Issues for Writing Test Cases for myPublicMethod
to Mock the private method in same class.
I want to mock the myPrivateMethod
method, as it should not be called but myPublicMethod
should be covered for test cases.
Both the methods are void.
I cannot change this design, I just have to complete and cover the required test cases for same.