Category "powermock"

org.powermock.api.mockito.ClassNotPreparedException when it's declared to be prepared

I don't understand why this is showing since my test definitely asked PowerMock to prepare for it. @PrepareForTest({AmazonSQSClientBuilder.class}) @RunWith(Powe

Mocking a object using powerMockito.whenNew() and using doNoting(object) but locally created object is calling actual method

public class A { public String[] processMessage(Message msg) { public boolean A(msg) { Utils utils = new Utils(); utils.meth

how to mock global variable in Mockito

I have a global variable global. My method has a line: global.getListOfObjects() I am trying to write a unit test and keep getting a NPE on the above line.

How to mock a local variables using mockito/powermock

I have a function as follows : private Response getHttpResponse(String url) { WebTarget target = client.target(url); Invocation.Builder requestBuilder =