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
When I create a mock for a Kotlin class, I should be able to mock a UInt or UByte response on a suspending function.
Current Behavior
The mock will return a Java Integer or Java Byte instead of the appropriate Kotlin unsigned type, this causes type mismatches and can lead to a ClassCastException.
Context
MockK version: 1.13.11
OS: MacOS Sonoma 14.4.1
Kotlin version: 1.9.24
JDK version: openjdk-17
JUnit version: 5.10.2
Type of test: unit test
Minimal reproducible code (the gist of this issue)
Note that removing the suspend keyword from the bar() function causes this test to pass.
The text was updated successfully, but these errors were encountered:
david-livefront
changed the title
UInt and UByte retur values cannot be mocked in suspending functions
UInt and UByte return values cannot be mocked in suspending functions
May 28, 2024
Prerequisites
Expected Behavior
When I create a mock for a Kotlin class, I should be able to mock a
UInt
orUByte
response on a suspending function.Current Behavior
The mock will return a Java Integer or Java Byte instead of the appropriate Kotlin unsigned type, this causes type mismatches and can lead to a
ClassCastException
.Context
MockK version: 1.13.11
OS: MacOS Sonoma 14.4.1
Kotlin version: 1.9.24
JDK version: openjdk-17
JUnit version: 5.10.2
Type of test: unit test
Minimal reproducible code (the gist of this issue)
Note that removing the
suspend
keyword from thebar()
function causes this test to pass.The text was updated successfully, but these errors were encountered: