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
open fun after(body: () -> Any) {
TransactionSynchronizationManager.registerSynchronization(
object : TransactionSynchronizationAdapter() {
override fun afterCommit() {
body()
}
}
)
}
Current Behavior
Method cannot be mocked:
io.mockk.MockKException: Failed matching mocking signature for
left matchers: [any()]
at io.mockk.impl.recording.SignatureMatcherDetector.detect(SignatureMatcherDetector.kt:99)
at io.mockk.impl.recording.states.RecordingState.signMatchers(RecordingState.kt:39)
at io.mockk.impl.recording.states.RecordingState.round(RecordingState.kt:31)
at io.mockk.impl.recording.CommonCallRecorder.round(CommonCallRecorder.kt:50)
at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:63)
at io.mockk.impl.eval.EveryBlockEvaluator.every(EveryBlockEvaluator.kt:30)
at io.mockk.MockKDsl.internalEvery(API.kt:93)
at io.mockk.MockKKt.every(MockK.kt:98)
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.12.3
Springmockk verison 3.1.1 (3.1.0) works correctly
OS: Linux + Mac
Kotlin version: 1.6.10
JDK version: 17
Type of test: unit test
The text was updated successfully, but these errors were encountered:
Hi @knyttl. Could you please see if you have a similar problem if you test with Spring Boot's native Mockito support?
And please also join a link to a repo containing a minimal reproduction of the issue, so that I can investigate.
Also note that there is an issue with spies on JDK17 (#65), so maybe it's a similar problem.
In the beggining I thought this is causes by upgrade of mockk, however in the end I found out this is causes by upgrade of springmockk.
For following code we are getting
Failed matching mocking signature for
errors on:Where after method is defined as:
Current Behavior
Method cannot be mocked:
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
The text was updated successfully, but these errors were encountered: