How can I verify that the second static method was invoked within the first static method using the PowerMock framework?
public class A {
public static int firstMethod(String s) {
return secondMethod(s, 10);
}
public static int secondMethod(String s, Integer i){
return /*some expression*/;
}
}
Update:
I haven't see yet any solution using the PowerMock framework. And definitely there are no acceptable answers for me in the linked question.
Update2:
@Test
public void test() {
PowerMockito.mockStatic(A.class);
Mockito.when(A.secondMethod(Mockito.anyString(), Mockito.anyInt())).thenReturn(1000);
A.firstMethod("test");
PowerMockito.verifyStatic();
}