I am trying to mock some reflection based methods. Below you can see the details,
Class Under Test
public class TracerLog {
@AroundInvoke
pu
Yeah the problem is that mockContext.getMethod()
is going to return null. So every time you run this, then call something on the result (getDeclaringClass() or getName()) you'll get the NPE. You probably want to use the RETURNS_DEEP_STUBS
default answer, when you set up the mock. Something like
@Mock( answer = RETURNS_DEEP_STUBS ) private InvocationContext mockContext;
should do the trick.