无法使用JAVA API在Wiremock中记录肥皂请求

时间:2019-12-10 12:22:38

标签: wiremock wiremock-standalone

我正在尝试通过Wiremock JAVA API记录肥皂请求,尝试使用以下代码进行记录,但在映射文件夹中看不到任何存根映射文件,请帮帮我。

请求:
 http://localhost:PORT_NUMBER/IntegrationServices/Bookings/BookFlow_v3(请求中包含xml数据)

 //Staring the wiremock server
             WireMockServer wireMockServer = new WireMockServer(options().port(HTTP_PORT).httpsPort(HTTPS_PORT));
                options().notifier(new ConsoleNotifier(true));
                WireMock.configureFor(HTTP_PORT);
                WireMock.configureFor(HTTPS_PORT);

                wireMockServer .start();

        //Staring wiremock recording
                      wireMockServer .startRecording(recordSpec().forTarget("server name")
                         .onlyRequestsMatching(getRequestedFor(urlMatching("/.+"))).captureHeader("Accept")
                         .captureHeader("Content-Type", true).ignoreRepeatRequests());
                      System.out.println("Wiremock server started recording");

                      SnapshotRecordResult snapshotRecordResult = server.stopRecording();
                      List<StubMapping> stubMappings = snapshotRecordResult.getStubMappings();

输出:存根大小为零但没有错误

0 个答案:

没有答案