Kotest + MockK = java.lang.NoClassDefFoundError: io/mockk/proxy/MockKAgentFactory

See original GitHub issue

https://github.com/mockk/mockk/issues/467 https://github.com/mockk/mockk/issues/459

    testImplementation 'io.kotest:kotest-runner-junit5-jvm:4.1.0' // for kotest framework
    testImplementation 'io.kotest:kotest-assertions-core-jvm:4.1.0' // for kotest core jvm assertions
    testImplementation 'io.kotest:kotest-property-jvm:4.1.0' // for kotest property test
    testImplementation 'io.kotest:kotest-runner-console-jvm:4.1.0' //for gutter |> icons w/ kotest plugin

Just wanted to put these on your radar in case the issue is with Kotest and not MockK. I can run the tests fine using ./gradlew test ..., but when I run using the Kotest plugin via Android Studio’s gutter icons, the above issues happen. Can’t test with the newest version because of https://github.com/kotest/kotest/issues/1601

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
DerekBeamcommented, Apr 15, 2022

This seems to still be an issue for me

1reaction
pawegiocommented, May 25, 2021

They say it’s a kotest plugin issue

I think so too. Running tests without kotest plugin, with gradle test task works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

io/mockk/proxy/MockKAgentFactory java.lang ... - GitHub
Prerequisites I am running the latest version I checked the documentation and found no answer I checked to make sure that this issue...
Read more >
Mockk spky throwing NoClassDefFoundError - Stack Overflow
It seems the change relates to Kotlin and was made at version 1.5. The change, KT-44912, relates to how the Kotlin compiler generates ......
Read more >
MockK: A Mocking Library for Kotlin - Baeldung
Here comes the MockK library, which offers support for Kotlin language features and constructs. MockK builds proxies for mocked classes. This ...
Read more >
MockK | mocking library for Kotlin
Provides DSL to mock behavior. Built from zero to fit Kotlin language. Supports named parameters, object mocks, coroutines and extension function mocking.
Read more >
System Extensions - Kotest
With Kotest System Extensions, these difficulties are made easy to mock and simulate, and your code can be tested correctly. After changing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found