I recently upgraded my Java version to Java11 for 8 and since then i am seeing this error:
java.lang.NoClassDefFoundError: Could not initialize class com.github.tomakehurst.wiremock.core.WireMockApp
at com.github.tomakehurst.wiremock.WireMockServer.(WireMockServer.java:73) at com.github.tomakehurst.wiremock.WireMockServer.(WireMockServer.java:112)
Below you can find my usage of wiremock:
@RunWith(PowerMockRunner.class)
@PrepareForTest(ConfigManagement.class)
@PowerMockIgnore({"javax.management.*","com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*","com.github.tomakehurst.*"})
public class MandateEventsJobTest {
private static HikariDataSource dataSource;
private WireMockServer wireMockServer;
@Before
public void setUp() throws Exception {
wireMockServer = new WireMockServer(8080);
wireMockServer.start();
stubFor(get(urlPathMatching("/ping")).willReturn(aResponse().withBody("pong")));
...
I'm not able to resolve this issue. Please help.