Top "Powermock" questions

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

PowerMock + Mockito VS Mockito alone

Can anyone please summarize, what exactly features gives you adding PowerMock on top of the Mockito? So far I've found …

java mocking mockito powermock
Unable to get Jacoco to work with Powermockito using offline instrumentation

Given that Jacoco doesn't play nicely with PowerMockito when instrumenting "on the fly", I've been trying to configure offline instrumentation …

java powermock jacoco
How to verify that an exception was not thrown

In my unit test using Mockito I want to verify that NullPointerException was not thrown. public void testNPENotThrown{ Calling calling= …

java mocking mockito powermock
Testing private method using power mock which return list of Integers

I have a private method which take a list of integer value returns me a list of integer value. How …

java easymock powermock
How to mock an enum singleton class using Mockito/Powermock?

I am unsure on how to mock an enum singleton class. public enum SingletonObject{ INSTANCE; private int num; protected setNum(…

java enums singleton mockito powermock
how to mock a URL connection

Hi I have a method that takes an URL as an input and determines if it is reachable. Heres the …

java junit mocking powermock jmockit
PowerMock: mock out private static final variable, a concrete example

what is the absolute minimal mocking that must be done to pass this test? code: class PrivateStaticFinal { private static final …

powermock
Powermock (With Easymock) no last call on a mock available

I am trying to just run a simple test case. I have the following method. public static void run(String[] …

java unit-testing junit easymock powermock
AndroidStudio/Gradle with powermock

I couldn't find any info on how to setup powermock with Android Studio/Gradle. Everything I've tried resulted in build …

android gradle powermock
What do I use instead of Whitebox in Mockito 2.2 to set fields?

When using Mockito 1.9.x I have been using Whiteboxto set values of fields to "inject" mocks. Se example below: @Before …

java tdd mockito junit4 powermock