Relative Content

Tag Archive for javamockitotestngpowermockpowermockito

Power Mock and Mockito Version Incompatible

I’m working on a legacy code base using JDK 1.8.
For one of my unit tests, I want to use PowerMock so that I can call the PowerMock.mockStatic() method on a static method (Provider.provider()) from the the javax.xml.ws.spi package.
However, as soon as I added the powermock-api-mockito2 dependency into my pom.xml, I got the following error when trying to execute my unit tests.
java.lang.NoSuchMethodError: org.mockito.Mockito.framework()Lorg/mockito/MockitoFramework;