I had the same problem and it took me a while to figure it out. My installation occupied an older version of jboss.javassist, which, oddly enough, prevented PowerMockRunner from working at all.
It is worth noting that I also have a mixed JUnit / TestNG environment. I previously tried the decision to add several shipyard providers, and that didn't work either (using surefire 2.14.1). After upgrading to surefire 2.17, both my JUnit and TestNG tests started working without the need to declare any warranty providers. In fact, the JUnit provider threw me an error because I use groups. The TestNG provider seems to allow free-form text (for example, "integration"), while the JUnit provider expects a class path (for example, "com.example.UnitTests").
Here is my plugin section ...
<plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <groups>spring, unit, integration</groups> <systemPropertyVariables> <java.awt.headless>true</java.awt.headless> <org.apache.activemq.default.directory.prefix>target/test/</org.apache.activemq.default.directory.prefix> <log4j.configuration>file:${project.basedir}/src/test/resources/log4j.properties</log4j.configuration> </systemPropertyVariables> <argLine>${surefire.args}</argLine> </configuration> </plugin>
... and related analytic prints ...
<dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>1.9.5</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <version>1.5.4</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito</artifactId> <version>1.5.4</version> <scope>test</scope> </dependency> <dependency> <groupId>jboss</groupId> <artifactId>javassist</artifactId> <version>3.8.0.GA</version> <scope>test</scope> </dependency>
source share