1

I am trying to record the soap request via wiremock JAVA API,tried to record by using the below code but I couldn't see any stub mappings files in the mapping folder,Please help me out.

Request:
http://localhost:PORT_NUMBER/IntegrationServices/Bookings/BookFlow_v3 (With xml data in request)

 //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();

Output: Getting stub size is zero but no error

Anant patil
  • 161
  • 1
  • 9
  • 1
    I got it,now its working fine actually issue was internally rest call is going as post method so getting none of the stubs matched. changed method from getRequestFor to postRequestedFor and added this configuration to wire mock object options().extensions(new ResponseTemplateTransformer(false); – Anant patil Dec 13 '19 at 14:42

0 Answers0