Top "Powermock" questions

Use this tag for questions about PowerMock, a Java library for creating mock objects for classes and methods.

Powermock mockstatic Cannot subclass final class

I am trying to mock a final class PowerMockito.mockStatic(TestFinalClass.class); It is working from my eclipse when I …

java eclipse maven junit powermock
after upgrade to 2.7 ClassNotFoundException: org.mockito.exceptions.Reporter when run test

I try to set up junit, mokito and powermock together but when I ran a test I get ClassNotFoundException :( testCompile …

java junit mockito powermock
PowerMock: mocking of static methods (+ return original values in some particular methods)

I use PowerMock 1.4.7 and JUnit 4.8.2 I need to mock only some static methods and I want others (from the same …

java mocking mockito powermock
Powermock verify private static method call in non static method

Dear stackoverflow comrades, I again have a problem in getting a specific PowerMock / Mockito case to work. The issue is, …

java mockito powermock non-static
Mocking method calls using power mockito - org.powermock.api.mockito.ClassNotPreparedException

I have an image loader class and i need to test some static methods in it. Since Mockito does not …

android unit-testing junit mockito powermock
PowerMock, mock a static method, THEN call real methods on all other statics

I'm setting up mocking a class' static methods. I have to do this in a @Before-annotated JUnit setup method. My …

java junit mockito powermock
Setting up Powemockito for static mocking

I would like to make use of Powermock with Mockito to mock some static method calls. I have followed instructions …

java eclipse unit-testing junit powermock
How do I use Powermock's Whitebox.invokeMethod(Object instance, Object... arguments) when my first method parameter is String type?

I would like to not explicitly name the method I am invoking in the invokeMethod() arguments. Powermock offers an overloaded …

java unit-testing junit powermock white-box
Is it possible to verify a mock method running in different thread in Mockito?

I have a method like the following, public void generateCSVFile(final Date billingDate) { asyncTaskExecutor.execute(new Runnable() { public void run() { …

java mocking mockito powermock
How can I mock an instance of an enum class with PowerMock & Mockito?

I tried to follow the example offered in the answer to this very similar question, but it does not work …

java enums mockito powermock powermockito