I\'m getting following exception once tests is started:
Testcase: treeCtorArgumentTest(com.xythos.client.drive.cachedtree.CachedTreeTest): Caused an ERR
Remove version declaration works for me:
Example:
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.8.9</version>
<scope>test</scope>
</dependency>
remove 2.8.9
After:
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
It may due to version issue between jar packages of this dependency.
Missing reference to:
Since Mockito 2.0.2 beta, Mockito-core has dependencies.
Just update to the latest release of org.mockito:mockito-core
. Once I did, the errors disappeared!
This problem with Mockito2 occurs if you enable the option to mock final classes.
This means when in your test/resources/mockito-extensions directory you have the file called org.mockito.plugins.MockMaker with the following content mock-maker-inline.
In that case byte-buddy, which is a transitive dependency for mockito-core, has the problem to attach own agent to the java process. But the problem occurs only when you use JRE.
The solution would be either:
or
-javaagent:byte-buddy-agent-*.jar
as a VM optionMockito 2 requires dependencies. Adding the two ByteBuddy dependencies below. solved the issue for me:
In my case I include jar files in the project, which can be found at: https://bintray.com/raphw/maven/ByteBuddy/
If you need it for a Maven project, simply add:
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.9.14</version>
<type>pom</type>
</dependency>
For me the problem was that IntelliJ ran the test as integration test. So I needed to create JUnit test manually