I have a class that calls method from another class to get the report status.
Class A {
private classb b = new classb();
method x() {
String xyz =b.method1( parm1, parm2)
}
}
So, when for Junit test for method x getting null pointer on b.method(). I have created mock for class b and did following
Mockito.doReturn(val).when(classbMock).method1(parm1,parm2);
Please help how can I mock the class b and get pass it.
Thanks