-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin - Unable to return value classes #456
Comments
Update: The issue seems to arise only when the mocked method is used within a runBlocking corroutine. When returning the mock inside a "normal" piece of code, the mocking is done properly. |
I'm adding a fully functional test:
|
Related issue https://youtrack.jetbrains.com/issue/KT-51641 |
does anybody have a workaround for this? I'm trying to use |
Same issue here, it's really annoying. |
For anyone else who found their way here, I found a workaround to using eq() and any() for an inline value class in #309 |
For me using the
|
Is this issue taken into work or it's root cause is known? It seems to be different from the one of mockito/mockito#2280, as it is specific to the mocked method execution within a I've also discovered that the behaviour somehow depends on the
While this one doesn't:
And the only difference is in |
This is also an issue with
It gets captured as the value not the value class meaning the equals fails |
When returning a value class from a mocked method, class cast can not be done properly
Sample code:
When executing that code and getting the mock the response is as follows:
Tested returning a simple type like String (to discard matcher failing) and worked successfully.
The text was updated successfully, but these errors were encountered: