Hy
I am trying to use MockK with Kotlin for backend services.
My development machines is windows with OpenJDK 11.0.8, for some strange reason, when I run the unit test the execution stay alive until test timeout is thrown with a following message:
bject.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
? java/lang/Object.hashCode (java.base@9/Object.java:122)
? java/util/HashMap.hash (java.base@9/HashMap.java:339)
? java/util/HashMap.get (java.base@9/HashMap.java:552)
? jdk/internal/reflect/Reflection.filterMethods (java.base@9/Reflection.java:276)
? java/lang/Class.getMethodHelper (java.base@9/Class.java:1412)
? java/lang/Class.getMethod (java.base@9/Class.java:1338)
kotlinVersion=1.4.10
testImplementation("io.mockk:mockk:1.10.2")
testImplementation("com.ninja-squad:springmockk:2.0.3")
My java version :
openjdk 11.0.8 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.21.0, JRE 11 Windows 10 amd64-64-Bit Compressed References 20200715_679 (JIT enabled, AOT enabled)
OpenJ9 - 34cf4c075
OMR - 113e54219
JCL - 95bb504fbb based on jdk-11.0.8+10)
Here is part of my test
private val payService: PayService = mockk()
private val payServiceImpl = PayServiceImpl(payService)
@BeforeEach
fun resetmockk() {
clearMocks(payService)
}
@Test
fun listEventError() {
coEvery { payService.getEvents(any()) }
}
Can you give me a solution to resolve this problem ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…