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
$ 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.
Test code : https://github.com/ganadist/minimal-reproducible-example/blob/k2-stub-lambda-npe/app/src/test/java/com/example/myapplication/MainActivityTest.kt#L39-L42
Stacktrace on Gradle Scan
The text was updated successfully, but these errors were encountered: