Can anyone give an idea of how to mock object creation for A a= new B()
using PowerMockito (Class B implements the interface A)?
I have tried as follows. But the mock object is not used in the class under the test but a new object is created under that class.
B b=Mockito.spy(B.class);
PowerMockito.whenNew(B.class).withNoArguments().thenReturn((b));