question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoSuchMethodError io.kotest.core.descriptors.Descriptor$TestDescriptor.path(boolean)

See original GitHub issue

After upgrading from Kotest version 5.3.2 to 5.4.0 for dependencies io.kotest:kotest-runner-junit5-jvm and io.kotest:kotest-assertions-core-jvm (additionally using io.kotest.extensions:kotest-extensions-spring version 1.1.1 and spring-boot.starter.parent version 2.7.2) I get the following error Exception:

'io.kotest.core.descriptors.TestPath io.kotest.core.descriptors.Descriptor$TestDescriptor.path(boolean)'
java.lang.NoSuchMethodError: 'io.kotest.core.descriptors.TestPath io.kotest.core.descriptors.Descriptor$TestDescriptor.path(boolean)'
	at io.kotest.extensions.spring.SpringTestExtension.methodName$kotest_extensions_spring(SpringTestExtension.kt:126)
	at io.kotest.extensions.spring.SpringTestExtension.method(SpringTestExtension.kt:100)
	at io.kotest.extensions.spring.SpringTestExtension.intercept(SpringTestExtension.kt:68)
	at io.kotest.engine.test.TestExtensions$intercept$execute$1$1.invokeSuspend(TestExtensions.kt:146)
	at io.kotest.engine.test.TestExtensions$intercept$execute$1$1.invoke(TestExtensions.kt)
	at io.kotest.engine.test.TestExtensions$intercept$execute$1$1.invoke(TestExtensions.kt)
	at io.kotest.engine.test.TestExtensions.intercept(TestExtensions.kt:154)
	at io.kotest.engine.test.interceptors.TestCaseExtensionInterceptor.intercept(TestCaseExtensionInterceptor.kt:24)
	at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:90)
	at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
	at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
	at io.kotest.engine.test.interceptors.CoroutineErrorCollectorInterceptor$intercept$3.invokeSuspend(CoroutineErrorCollectorInterceptor.kt:28)
	at io.kotest.engine.test.interceptors.CoroutineErrorCollectorInterceptor$intercept$3.invoke(CoroutineErrorCollectorInterceptor.kt)
	at io.kotest.engine.test.interceptors.CoroutineErrorCollectorInterceptor$intercept$3.invoke(CoroutineErrorCollectorInterceptor.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
	at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
	at io.kotest.engine.test.interceptors.CoroutineErrorCollectorInterceptor.intercept(CoroutineErrorCollectorInterceptor.kt:27)
	at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invokeSuspend(TestCaseExecutor.kt:90)
	at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
	at io.kotest.engine.test.TestCaseExecutor$execute$2$1.invoke(TestCaseExecutor.kt)
	at io.kotest.engine.test.interceptors.CoroutineDispatcherFactoryInterceptor$intercept$4.invokeSuspend(coroutineDispatcherFactoryInterceptor.kt:57)
	at io.kotest.engine.test.interceptors.CoroutineDispatcherFactoryInterceptor$intercept$4.invoke(coroutineDispatcherFactoryInterceptor.kt)
	at io.kotest.engine.test.interceptors.CoroutineDispatcherFactoryInterceptor$intercept$4.invoke(coroutineDispatcherFactoryInterceptor.kt)
	at io.kotest.engine.concurrency.FixedThreadCoroutineDispatcherFactory$withDispatcher$4.invokeSuspend(FixedThreadCoroutineDispatcherFactory.kt:53)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

Minimal class to reproduce:

package com.acme.foo

import org.assertj.core.api.Assertions.assertThat
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest(
    webEnvironment = SpringBootTest.WebEnvironment.NONE,
)
class HealthCheckRemoteTest : SpringStringSpec() {

    init {
        "This is a fancy test" {
            assertThat(true).isEqualTo(true)
        }
    }
}

where SpringStringSpec is defined as

package com.acme.foo

import io.kotest.core.extensions.Extension
import io.kotest.core.spec.style.StringSpec
import io.kotest.extensions.spring.SpringExtension

abstract class SpringStringSpec : StringSpec() {

    override fun extensions(): List<Extension> = listOf(SpringExtension)
}

I am using my workaround from https://github.com/Kotlin/kotlinx.coroutines/issues/3345#event-6985037804 but even if I remove it, I encounter the same error.

Any hints?

Cheers, Maestro

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

7reactions
sksamuelcommented, Jul 28, 2022

1.1.2 should be good for you then.

On Thu, Jul 28, 2022, 7:57 AM Timo Rantalaiho @.***> wrote:

Oh yes: using io.kotest.extensions:kotest-extensions-spring:1.1.0.50-SNAPSHOT from the Sonatype snapshots repo works too 👍

— Reply to this email directly, view it on GitHub https://github.com/kotest/kotest/issues/3122#issuecomment-1198105969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFVSGTRO5CQNID5T6EEECDVWJ7TXANCNFSM54SGXHOQ . You are receiving this because you were mentioned.Message ID: @.***>

0reactions
MrTomatocommented, Jul 29, 2022

yup, mine work now too - thanks @sksamuel!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog - Kotest
Fix regression which causes NoSuchMethodError when using the Kotest Spring ... use ExperimentalKotest more broadly, it was moved from io.kotest.core.config.
Read more >
Why IntelliJ Kotest plugin does not work well? - Stack Overflow
The test class compiles and the jar kotest-core-jvm-4.1.1.jar is included as external library. Can someone give some advice on this? kotlin ...
Read more >
path - method of io.kotest.core.descriptors.SpecDescriptor class
Learn how to use path method in io.kotest.core.descriptors.SpecDescriptor for your next Kotest project with LambdaTest Automation Testing Advisor.
Read more >
java.lang.NoSuchMethodError: org.testng.Assert.assertTrue
I'm receiving the following error below when I try to use assertTrue(boolean,String) If I use assertTrue(boolean) it will work. Any idea what 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