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
Please answer the following questions for yourself before submitting an issue.
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed
Expected Behavior
Tests are working.
Current Behavior
Exception from mockk
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
step 1
step 2
you get it...
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
MockK version: 1.13.1
OS: macOS 12.6
Kotlin version: 1.17.10
JDK version: Java 19
JUnit version: 5.9.2
Type of test: unit test
Failure Logs
Please include any relevant log snippets or files here.
Stack trace
// -----------------------[ YOUR STACK STARTS HERE ] -----------------------
io.mockk.MockKException: Missing mocked calls inside every { ... } block: make sure the object inside the block is a mock
at app//io.mockk.impl.recording.states.StubbingState.checkMissingCalls(StubbingState.kt:14)
at app//io.mockk.impl.recording.states.StubbingState.recordingDone(StubbingState.kt:8)
at app//io.mockk.impl.recording.CommonCallRecorder.done(CommonCallRecorder.kt:47)
at app//io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:64)
at app//io.mockk.impl.eval.EveryBlockEvaluator.every(EveryBlockEvaluator.kt:30)
at app//io.mockk.MockKDsl.internalEvery(API.kt:93)
at app//io.mockk.MockKKt.every(MockK.kt:98)
// -----------------------[ YOUR STACK TRACE ENDS HERE ] -----------------------
Minimal reproducible code (the gist of this issue)
// -----------------------[ GRADLE DEFINITIONS ] -----------------------
testFixturesApi("io.mockk:mockk-jvm:1.13.1")
// -----------------------[ YOUR CODE STARTS HERE ] -----------------------packageio.mockk.ghimportio.mockk.*importkotlin.test.TestclassIssue69Test {
privateval startTime:Instant=Instant.now()
@BeforeEach
funsetup() {
// Mocking instant to return always value on now().
mockkStatic(Instant::class)
every { Instant.now() } returns startTime
}
}
// -----------------------[ YOUR CODE ENDS HERE ] -----------------------
The text was updated successfully, but these errors were encountered:
Having the same issue but running and building on JVM 17.
It seems to not recognize the mockkStatic(Instant::class) when trying to mock the static call.
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
Tests are working.
Current Behavior
Exception from mockk
Failure Information (for bugs)
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
Please include any relevant log snippets or files here.
Stack trace
Minimal reproducible code (the gist of this issue)
The text was updated successfully, but these errors were encountered: