I have a problem when active mockito inline. The test works perfectly in normal mode. The error is:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 25.556 s <<< FAILURE! - in es.ddmain.utils.FileSystemUtilsTest
[ERROR] testIntentarSubirImagenYtestBorrarFichero Time elapsed: 25.548 s <<< ERROR!
java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
at es.ddmain.utils.FileSystemUtilsTest.testIntentarSubirImagenYtestBorrarFichero(FileSystemUtilsTest.java:61)
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.CompoundEnumeration@249676e4
at es.ddmain.utils.FileSystemUtilsTest.testIntentarSubirImagenYtestBorrarFichero(FileSystemUtilsTest.java:61)
Caused by: java.lang.reflect.InvocationTargetException
at es.ddmain.utils.FileSystemUtilsTest.testIntentarSubirImagenYtestBorrarFichero(FileSystemUtilsTest.java:61)
Caused by: org.mockito.exceptions.base.MockitoInitializationException:
Could not initialize inline Byte Buddy mock maker.
It appears as if your JDK does not supply a working agent attachment mechanism.
Java : 11
JVM vendor name : Oracle Corporation
JVM vendor version : 11.0.2+9-LTS
JVM name : Java HotSpot(TM) 64-Bit Server VM
JVM version : 11.0.2+9-LTS
JVM info : mixed mode
OS name : Windows 7
OS version : 6.1
at es.ddmain.utils.FileSystemUtilsTest.testIntentarSubirImagenYtestBorrarFichero(FileSystemUtilsTest.java:61)
Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process
at es.ddmain.utils.FileSystemUtilsTest.testIntentarSubirImagenYtestBorrarFichero(FileSystemUtilsTest.java:61)
[EDIT] Sorry, i forgot to include version of mockito.
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
what can i do to fix this? I'm noob in mockito
Thanks
Most likely you ran across Could not self-attach to current VM using external process (ByteBuddyAgent.installExtension) #2741
Mockito is known not to be able to mock a few classes it uses in its internals. The issue is closed as infeasable