I\'m getting following exception once tests is started:
Testcase: treeCtorArgumentTest(com.xythos.client.drive.cachedtree.CachedTreeTest): Caused an ERR
I had the same problem - same stacktrace appear in my log. It is typically problem with project setup... OR
The problem can be in the bytebuddys JARs if these were not downloaded correctly.
When I try to check class ClassLoadingStrategy manually then I get zip error.
In that case it is just enough manually delete the Byte Buddy from local maven directory, usually located at:
{home}/.m2/repository/net/bytebuddy/
The next try to run project or test they will be downloaded again and should work as expected.
Unfortunatelly common Java ClassLoader faces in the same way when class or jar missing as well as the jar is corrupted.
In my case, after removing mockito-core
, the test worked!
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
My version is here, and JDK is 1.8.0_121.
<properties>
<powermock.version>2.0.7</powermock.version>
<mockito.version>2.8.9</mockito.version>
</properties>
Now my dependencies are:
I have had the same problem in one existing project. I used java 8 and additionally installed java 10. So I started get this exception. I deinstalled java 10, it has not helped. I deleted bytebuddy jars from maven repo, it has not helped. Only after complete removal of all jars from maven repo I could compile project again.
Explicitly define mockito dependency as the version in your powermock and springboot differs testCompile group: 'org.mockito', name: 'mockito-core', version: '2.8.9'
In my case, I was working on a project that does not use the maven build system. So this is what worked for me.
NB: (creating the library is optional, you can add the jars directly to your project build path)
Hope this helps someone.
I solved this problem by removing jmockit in POM XML for Maven. After that my Junit 5 tests work perfectly.
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>1.41</version>
<scope>test</scope>
</dependency>
With this dependency I always get an error like:
java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
...
Could not initialize inline Byte Buddy mock maker. (This mock maker is not supported on Android.)
...
Caused by: com.sun.tools.attach.AttachNotSupportedException: no providers installed
...