https://kotlinlang.org logo
#kotest
Title
# kotest
r

Rajkumar Singh

07/28/2022, 4:27 AM
switched <kotest.version>5.3.2</kotest.version> to <kotest.version>5.4.0</kotest.version> and now I'm getting
java.lang.NoSuchMethodError
j

Jim

07/28/2022, 4:37 AM
Can you create an issue on the main repo? Blowing up this channel with a stack trace is hard to look though
r

Rajkumar Singh

07/28/2022, 6:13 AM
here's the log . __ _ __ _ _ /\\ / _' _ _ ()_ _ _ _ \ \ \ \ ( ( )\___ | '_ | '| | ' \/ _` | \ \ \ \ \\/ __)| |)| | | | | || (_| | ) ) ) ) ' |___| .|| ||| |\_, | / / / / =========||==============|_/=//// :: Spring Boot :: (v2.7.2) 2022-07-27 203248,218 [main] INFO UnitTestExceptionHandler - Starting UnitTestExceptionHandler using Java 11.0.15 2022-07-27 203248,219 [main] DEBUG UnitTestExceptionHandler - Running with Spring Boot v2.7.2, Spring v5.3.22 2022-07-27 203308,374 [main] INFO com.azure.core.implementation.jackson.JacksonVersion - Package versions: jackson-annotations=2.13.3, jackson-core=2.13.3, jackson-databind=2.13.3, jackson-dataformat-xml=2.13.3, jackson-datatype-jsr310=2.13.3, azure-core=1.28.0, Troubleshooting version conflicts: 2022-07-27 203308,647 [main] INFO com.azure.spring.cloud.core.implementation.factory.AbstractAzureServiceClientBuilderFactory - Will configure the default credential of type DefaultAzureCredential for class com.azure.identity.DefaultAzureCredentialBuilder. 2022-07-27 203310,425 [main] INFO org.springframework.boot.test.mock.web.SpringBootMockServletContext - Initializing Spring TestDispatcherServlet '' 2022-07-27 203310,426 [main] INFO org.springframework.test.web.servlet.TestDispatcherServlet - Initializing Servlet '' 2022-07-27 203310,536 [main] INFO org.springframework.test.web.servlet.TestDispatcherServlet - Completed initialization in 109 ms 2022-07-27 203310,859 [main] INFO UnitTestExceptionHandler - Started UnitTestExceptionHandler in 24.907 seconds (JVM running for 51.192) 2022-07-27 203311,054 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [UnitTestExceptionHandler], using SpringBootContextLoader 2022-07-27 203311,056 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [UnitTestExceptionHandler]: no resource found for suffixes {-context.xml, Context.groovy}. 2022-07-27 203311,056 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [UnitTestExceptionHandler]: UnitTestExceptionHandler does not declare any static, non-private, non-final, nested classes annotated with @Configuration. 2022-07-27 203311,071 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration Application for test class UnitTestExceptionHandler 2022-07-27 203311,073 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, com.ninjasquad.springmockk.MockkTestExecutionListener, com.ninjasquad.springmockk.ClearMocksTestExecutionListener] 2022-07-27 203311,074 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@5b3f0552, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@432fca40, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@de06f28, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@71662b15, com.ninjasquad.springmockk.MockkTestExecutionListener@52d0a5fe, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@6f10082e, org.springframework.test.context.support.DirtiesContextTestExecutionListener@6107b3cb, org.springframework.test.context.transaction.TransactionalTestExecutionListener@2179127d, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@76d1acf9, org.springframework.test.context.event.EventPublishingTestExecutionListener@196f9b75, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@452aea78, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@2ca9e25a, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@57642552, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@32b5b8f8, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@205efdfc, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@4306709f, com.ninjasquad.springmockk.ClearMocksTestExecutionListener@35be9318] '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:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
following maven dependencies are declared in the pom.xml
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.7.2</version> </parent> <properties> <java.version>11</java.version> <kotlin.version>1.7.10</kotlin.version> <kotlin-coroutines.version>1.6.4</kotlin-coroutines.version> <kotlin.code.style>official</kotlin.code.style> <kotlin.compiler.incremental>true</kotlin.compiler.incremental> <kotest.version>5.4.0</kotest.version> <kotest-extensions-spring.version>1.1.1</kotest-extensions-spring.version> <properties> <dependency> <groupId>io.kotest</groupId> <artifactId>kotest-runner-junit5-jvm</artifactId> <version>${kotest.version}</version> </dependency> <dependency> <groupId>io.kotest</groupId> <artifactId>kotest-assertions-core-jvm</artifactId> <version>${kotest.version}</version> </dependency> <dependency> <groupId>io.kotest</groupId> <artifactId>kotest-property-jvm</artifactId> <version>${kotest.version}</version> </dependency> <dependency> <groupId>io.kotest.extensions</groupId> <artifactId>kotest-extensions-spring</artifactId> <version>${kotest-extensions-spring.version}</version> </dependency>
s

sam

07/28/2022, 6:39 AM
Can you try adding explicit dependencies on kotest framework api, and framework engine
e

Emil Kantis

07/28/2022, 7:24 AM
r

Rajkumar Singh

07/28/2022, 7:34 AM
@sam added following as you suggested:
Copy code
<dependency>
   <groupId>io.kotest</groupId>
   <artifactId>kotest-framework-api-jvm</artifactId>
   <version>${kotest.version}</version>
</dependency>
<dependency>
   <groupId>io.kotest</groupId>
   <artifactId>kotest-framework-engine-jvm</artifactId>
   <version>${kotest.version}</version>
</dependency>
s

sam

07/28/2022, 7:35 AM
Did it work ?
r

Rajkumar Singh

07/28/2022, 7:35 AM
still running into same issue
s

sam

07/28/2022, 8:31 AM
5.4.1 will be released today which fixes this.
11 Views