You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked to make sure that this issue has not already been filed
Expected Behavior
Test passes.
Current Behavior
Test fails.
Failure Information (for bugs)
Test fails with io.mockk.MockKException: Missing calls inside verify { ... } block. when compiled for JDK target version 21.
But it passes if compiled for JDK target version 19.
Steps to Reproduce
Use the code example at the end of the description
Make sure it is compiled for JDK target version 21
Run the test, and it fails
Context
MockK version: 1.13.8
OS: MacOS 14.2.1
Kotlin version: 1.9.21
JDK version: 21.0.1
JUnit version: 5.8.2
Type of test: unit test
Stack trace
io.mockk.MockKException: Missing calls inside verify { ... } block.
at io.mockk.impl.recording.states.VerifyingState.checkMissingCalls(VerifyingState.kt:52)
at io.mockk.impl.recording.states.VerifyingState.recordingDone(VerifyingState.kt:21)
at io.mockk.impl.recording.CommonCallRecorder.done(CommonCallRecorder.kt:47)
at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:63)
at io.mockk.impl.eval.VerifyBlockEvaluator.verify(VerifyBlockEvaluator.kt:30)
at io.mockk.MockKDsl.internalVerify(API.kt:120)
at io.mockk.MockKKt.verify(MockK.kt:218)
at io.mockk.MockKKt.verify$default(MockK.kt:209)
Minimal reproducible code (the gist of this issue)
importio.mockk.spykimportio.mockk.verifyimportorg.junit.jupiter.api.TestclassTestClass {
privatedata classSuchClass(
valsuchAttribute:String,
)
@Test
funtest() {
val s =SuchClass(suchAttribute ="string")
val spy = spyk<SuchClass>(s)
spy.suchAttribute
verify(exactly =1) { spy.suchAttribute }
}
}
The text was updated successfully, but these errors were encountered:
Prerequisites
Expected Behavior
Test passes.
Current Behavior
Test fails.
Failure Information (for bugs)
Test fails with
io.mockk.MockKException: Missing calls inside verify { ... } block.
when compiled for JDK target version 21.But it passes if compiled for JDK target version 19.
Steps to Reproduce
Context
Stack trace
Minimal reproducible code (the gist of this issue)
The text was updated successfully, but these errors were encountered: