I have a kotlin spring boot app with junit5 tests and gradle as build tool. There are some unit tests and some integration tests. Everything works fine on my local machine with all tests passing. But when I run them on pipeline, the unit tests are passing but integration tests are failing with java.lang.NoClassDefFoundError which seems quite weird.
<span>java.lang.NoClassDefFoundError: Could not initialize class com.xxx.xxx.manager.ContactManagerIntegrationTest</span><span> at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</span><span> at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(<a href="http://nativeconstructoraccessorimpl.java:62/" target="_blank" rel="noopener nofollow noreferrer">NativeConstructorAccessorImpl.java:62</a>)</span><span> at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(<a href="http://delegatingconstructoraccessorimpl.java:45/" target="_blank" rel="noopener nofollow noreferrer">DelegatingConstructorAccessorImpl.java:45</a>)</span><span> at java.base/java.lang.reflect.Constructor.newInstance(<a href="http://constructor.java:490/" target="_blank" rel="noopener nofollow noreferrer">Constructor.java:490</a>)</span><span> at org.junit.platform.commons.util.ReflectionUtils.newInstance(<a href="http://reflectionutils.java:500/" target="_blank" rel="noopener nofollow noreferrer">ReflectionUtils.java:500</a>)</span><span> at org.junit.jupiter.engine.execution.ConstructorInvocation.proceed(<a href="http://constructorinvocation.java:56/" target="_blank" rel="noopener nofollow noreferrer">ConstructorInvocation.java:56</a>)</span><span> at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(<a href="http://invocationinterceptorchain.java:125/" target="_blank" rel="noopener nofollow noreferrer">InvocationInterceptorChain.java:125</a>)</span><span> at org.junit.jupiter.api.extension.InvocationInterceptor.interceptTestClassConstructor(<a href="http://invocationinterceptor.java:69/" target="_blank" rel="noopener nofollow noreferrer">InvocationInterceptor.java:69</a>)</span><span> at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(<a href="http://executableinvoker.java:105/" target="_blank" rel="noopener nofollow noreferrer">ExecutableInvoker.java:105</a>)</span><span> at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(<a href="http://invocationinterceptorchain.java:104/" target="_blank" rel="noopener nofollow noreferrer">InvocationInterceptorChain.java:104</a>)</span><span> at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(<a href="http://invocationinterceptorchain.java:62/" target="_blank" rel="noopener nofollow noreferrer">InvocationInterceptorChain.java:62</a>)</span><span> at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(<a href="http://invocationinterceptorchain.java:43/" target="_blank" rel="noopener nofollow noreferrer">InvocationInterceptorChain.java:43</a>)</span><span> at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(<a href="http://invocationinterceptorchain.java:35/" target="_blank" rel="noopener nofollow noreferrer">InvocationInterceptorChain.java:35</a>)</span><span> at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(<a href="http://executableinvoker.java:104/" target="_blank" rel="noopener nofollow noreferrer">ExecutableInvoker.java:104</a>)</span><span> at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(<a href="http://executableinvoker.java:77/" target="_blank" rel="noopener nofollow noreferrer">ExecutableInvoker.java:77</a>)</span><span>java.lang.NoClassDefFoundError: Could not initialize class com.xxx.xxx.manager.ContactManagerIntegrationTest</span>
I am using `adoptopenjdk/openjdk11` as the bitbucket pipeline image. I am not sure how to go about debugging this problem.