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
When using Kotlin, the SpringBootTest.UseMainMethod.ALWAYS option is unable to locate the main method. The main/blocker issue here is not being able to use the ApplicationContextInitializers that are added in the main method.
Caused by: java.lang.IllegalStateException: Main method not found on 'com.example.demo.DemoApplication'
at org.springframework.util.Assert.state(Assert.java:97)
at org.springframework.boot.test.context.SpringBootContextLoader.getMainMethod(SpringBootContextLoader.java:156)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:125)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:105)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:183)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)
... 87 more
The text was updated successfully, but these errors were encountered:
philwebb
changed the title
UseMainMethod.Always not working with Kotlin
Test with UseMainMethod.Always do not work with Kotlin main functions
Nov 16, 2022
When using Kotlin, the
SpringBootTest.UseMainMethod.ALWAYS
option is unable to locate the main method. The main/blocker issue here is not being able to use theApplicationContextInitializers
that are added in the main method.The text was updated successfully, but these errors were encountered: