I want to check if a private method is called inside my tested method. Since the method is private I use this :
PowerMockito.verifyPrivate(societeHome, times(1)).invoke("createFournisseurSocieteBinding", Mockito.any());
This test ALWAYS passes, I could write times(1000)
and it still works ! So I put a breakpoint in the method createFournisseurSocieteBinding
and it is called when I launch the verifyPrivate
method !! How is this the wanted behaviour since I want to check if my TESTED method does call the createFournisseurSocieteBinding
and not the verifyPrivate
method.
Is there a way to check if my tested method calls an inner method which is private ? It works fine with non-private methods with Mockito.verify(...)