我最近将我的 Java 版本升级到 Java11 for 8,从那以后我看到了这个错误:
java.lang.NoClassDefFoundError:无法初始化类 com.github.tomakehurst.wiremock.core.WireMockApp
在 com.github.tomakehurst.wiremock.WireMockServer.(WireMockServer.java:73) 在 com.github.tomakehurst.wiremock.WireMockServer.(WireMockServer.java:112)
下面你可以找到我对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")));
...
我无法解决这个问题。请帮忙。