https://github.com/stuebingerb/kotlin-mockk-bug-repro
Small repository to reproduce an issue with mockk and Kotlin 1.7.20+
https://github.com/stuebingerb/kotlin-mockk-bug-repro
byte-buddy kotlin mockk
Last synced: about 1 year ago
JSON representation
Small repository to reproduce an issue with mockk and Kotlin 1.7.20+
- Host: GitHub
- URL: https://github.com/stuebingerb/kotlin-mockk-bug-repro
- Owner: stuebingerb
- Archived: true
- Created: 2022-11-23T13:13:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-23T14:28:13.000Z (over 3 years ago)
- Last Synced: 2025-02-21T17:49:58.845Z (over 1 year ago)
- Topics: byte-buddy, kotlin, mockk
- Language: Kotlin
- Homepage: https://youtrack.jetbrains.com/issue/KT-55125/Difference-in-generated-bytecode-for-open-suspend-functions-of-generic-classes
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kotlin Mockk Bug Repro
Small repository to reproduce an issue with mockk and Kotlin 1.7.20+
To reproduce:
```
$ mvn clean verify -Dkotlin.version=1.7.21
```
```
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running de.stuebingerb.ProductRepositoryTest
Nov. 23, 2022 2:40:52 PM io.mockk.impl.log.JULLogger warn
WARNUNG: Failed to transform class de/stuebingerb/AbstractPersistence
java.lang.StackOverflowError
at java.base/java.util.StringJoiner.(StringJoiner.java:133)
at java.base/java.util.StringJoiner.(StringJoiner.java:105)
at java.base/java.lang.reflect.Modifier.toString(Modifier.java:229)
at net.bytebuddy.description.method.MethodDescription$AbstractBase.toString(MethodDescription.java:998)
at java.base/java.lang.String.valueOf(String.java:4213)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
at net.bytebuddy.description.TypeVariableSource$AbstractBase.findExpectedVariable(TypeVariableSource.java:174)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onTypeVariable(TypeDescription.java:2062)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onTypeVariable(TypeDescription.java:1973)
at net.bytebuddy.description.type.TypeDescription$Generic$OfTypeVariable$Symbolic.accept(TypeDescription.java:5931)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor.onParameterizedType(TypeDescription.java:1908)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onParameterizedType(TypeDescription.java:1973)
at net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType.accept(TypeDescription.java:5134)
at net.bytebuddy.description.method.ParameterDescription$Latent.getType(ParameterDescription.java:805)
at net.bytebuddy.description.method.ParameterList$AbstractBase.asTypeList(ParameterList.java:107)
at net.bytebuddy.description.method.MethodDescription$AbstractBase.toString(MethodDescription.java:1006)
at java.base/java.lang.String.valueOf(String.java:4213)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
...
at java.base/java.lang.String.valueOf(String.java:4213)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:173)
at net.bytebuddy.description.TypeVariableSource$AbstractBase.findExpectedVariable(TypeVariableSource.java:174)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onTypeVariable(TypeDescription.java:2062)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onTypeVariable(TypeDescription.java:1973)
at net.bytebuddy.description.type.TypeDescription$Generic$OfTypeVariable$Symbolic.accept(TypeDescription.java:5931)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor.onParameterizedType(TypeDescription.java:1908)
at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForAttachment.onParameterizedType(TypeDescription.java:1973)
at net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType.accept(TypeDescription.java:5134)
at net.bytebuddy.description.method.ParameterDescription$Latent.getType(ParameterDescription.java:805)
at net.bytebuddy.description.method.ParameterList$AbstractBase.asTypeList(ParameterList.java:107)
at net.bytebuddy.description.method.MethodDescription$AbstractBase.toString(MethodDescription.java:1006)
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.19 s <<< FAILURE! - in de.stuebingerb.ProductRepositoryTest
[ERROR] test Time elapsed: 0.926 s <<< ERROR!
io.mockk.MockKException:
Failed matching mocking signature for
left matchers: [any()]
at de.stuebingerb.ProductRepositoryTest.test(ProductRepositoryTest.kt:17)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ProductRepositoryTest.test:17 » MockK Failed matching mocking signature for
l...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
```
Works with Kotlin 1.7.10:
```
$ mvn clean verify -Dkotlin.version=1.7.10
```
```
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running de.stuebingerb.ProductRepositoryTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.63 s - in de.stuebingerb.ProductRepositoryTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
```