Open
Description
- Reproducible step
$ git clone https://github.com/ganadist/minimal-reproducible-example -b k2-stub-lambda-npe k2
Cloning into 'k2'...
$ cd k2
$ git checkout HEAD~1
# perform unittest with kotlin 1.9.23
$ ./gradlew :app:tDDUT
...
MainActivityTest > test1 STARTED
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
MainActivityTest > test1 PASSED
$ git checkout origin/k2-stub-lambda-npe
# perform unittest with kotlin 2.0.20
$ ./gradlew :app:tDDUT
MainActivityTest > test1 STARTED
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
MainActivityTest > test1 FAILED
org.mockito.kotlin.MockitoKotlinException at MainActivityTest.kt:41
Caused by: java.lang.NullPointerException at MainActivityTest.kt:41
org.mockito.kotlin.MockitoKotlinException: NullPointerException thrown when stubbing.
This may be due to two reasons:
The method you're trying to stub threw an NPE: look at the stack trace below;
You're trying to stub a generic method: try `onGeneric` instead.
Metadata
Metadata
Assignees
Labels
No labels