Top "Powermockito" questions

Use this tag for questions about PowerMockito, a Java Framework that allows the mocking of usually un-mockable types, i.e. statics, and private methods, in conjunction with the Mockito framework.

Verify Static Method Call using PowerMockito 1.6

I am writing JUnit test case for methods similar to sample given below: Class SampleA{ public static void methodA(){ boolean …

java mockito junit4 powermock powermockito
How to mock a Kotlin singleton object?

Given a Kotlin singleton object and a fun that call it's method object SomeObject { fun someFun() {} } fun callerFun() { SomeObject.someFun() } …

mocking mockito kotlin powermock powermockito
java.lang.NoClassDefFoundError: Could not initialize class org.mockito.internal.util.MockUtil

I want to use testng + powermock + spring to run test code,my jar version is: powermock = 1.6.2 powermock-module-testng = 1.6.2 mockito = 1.10.19 testng = 6.8.7 spring = 4.1.1.…

java mockito testng powermockito
MockClassLoader cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl

I am in the middle of migrating a project into Java9, The Tests start failing after I switched to the …

java maven powermock powermockito
Mocking a method which returns Page interface

I have a method which I need to write unit test case. The method returns a Page type. How can …

java junit mockito powermockito
Cannot use PowerMockRunner with SpringBootTest

For my project, i am trying to write integration test using SpringBootTest. I have 3rd party static final class. I …

spring spring-boot integration-testing powermockito
Extension API internal error: org.powermock.api.extension.reporter.MockingFrameworkReporterFactoryImpl

I'm trying to write a unit test using PowerMockRunner but I got the following error: java.lang.IllegalStateException: Extension API …

java eclipse junit powermock powermockito
Mocking a private constructor

The Site class is provided to me by an external team and has a private constructor. public class Site { int …

java powermockito
How to test a method returns boolean in Mockito

I am learning how to unit-testing in android studio. As shown below, I have a method called "isValidUrl" and in …

android junit mockito junit4 powermockito
How to mock constructor with PowerMockito

I'm trying to mock a class constructor with PowerMockito for first time, but it doesn't work. My current code is: …

java android mockito powermockito