In tests like this it breaks with error
class MyTest {
val m = mockk<MockedClass>()
@Test
fun test(){}
}
java.lang.ExceptionInInitializerError
Caused by: java.lang.IllegalStateException: Error during attachment using: net.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound@308a6984
Caused by: java.lang.reflect.InvocationTargetException
Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
But when I remove Test
from class name it works. Should I be concerned? Is there a way to fix this?
I use Java 8, Kotlin 1.9.22, Spring Boot 2.7.10 and com.ninja-squad.springmockk 3.1.2 (also tried io.mockk.mockk last and 1.9.3 versions – same problem) ((May look like overwork but reason was found after a lot of time))