RKK
09/19/2024, 12:12 PMRKK
09/19/2024, 12:19 PMLee Turner
09/19/2024, 12:24 PMLee Turner
09/19/2024, 12:25 PMRKK
09/19/2024, 12:26 PM<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-wiremock</artifactId>
</dependency>
RKK
09/19/2024, 12:26 PMRKK
09/19/2024, 12:30 PMLee Turner
09/19/2024, 12:30 PMspring-cloud-contract-wiremock
uses a really old version of WireMock but it uses WireMock standalone so the version of jetty might not be so importantLee Turner
09/19/2024, 12:31 PMLee Turner
09/19/2024, 12:33 PMspring-cloud-contract-wiremock
to be honest so not sure how much help I can be. How feasible is it to put a simple demo app together demonstrating the problem?RKK
09/19/2024, 12:33 PM<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-jetty12</artifactId>
<version>3.9.1</version>
<scope>test</scope>
</dependency>
@`Lee Turner
09/19/2024, 12:33 PMspring-cloud-contract-wiremock
RKK
09/19/2024, 12:34 PMLee Turner
09/19/2024, 12:34 PMRKK
09/19/2024, 12:35 PMRKK
09/19/2024, 12:37 PMstubFor(get(urlPathEqualTo("/abc/path"))
.inScenario(scenarioName)
.whenScenarioStateIs(STARTED)
.willReturn(aResponse()
.withStatus(OK.value())
.withHeader(CONTENT_TYPE, APPLICATION_JSON_VALUE)
.withHeader(HEADER_TRACE_ID, HTTP_HEADERS.getFirst(HEADER_TRACE_ID))
.withBodyFile("get-international-pending-payments-811-response-200.json"))
.willSetStateTo(firstSuccessState));
// Second request fails with 4xx error
stubFor(get(urlPathEqualTo("/abc/path"))
.inScenario(scenarioName)
.whenScenarioStateIs(firstSuccessState)
.willReturn(aResponse()
.withStatus(BAD_REQUEST.value())
.withHeader(CONTENT_TYPE, APPLICATION_JSON_VALUE)
.withHeader(HEADER_TRACE_ID, HTTP_HEADERS.getFirst(HEADER_TRACE_ID))
.withBodyFile("get-international-pending-payments-811-response-400.json"))
.willSetStateTo(secondFailureState));
// Third request fails with 5xx error
stubFor(get(urlPathEqualTo("/abc/path"))
.inScenario(scenarioName)
.whenScenarioStateIs(secondFailureState)
.willReturn(aResponse()
.withStatus(SERVICE_UNAVAILABLE.value())
.withHeader(CONTENT_TYPE, APPLICATION_JSON_VALUE)
.withHeader(HEADER_TRACE_ID, HTTP_HEADERS.getFirst(HEADER_TRACE_ID))
.withBodyFile("get-international-pending-payments-811-response-503.json"))
.willSetStateTo(STARTED));
Lee Turner
09/19/2024, 12:37 PMRKK
09/19/2024, 12:38 PMLee Turner
09/19/2024, 12:39 PMRKK
09/19/2024, 12:40 PMRKK
09/19/2024, 12:45 PM/abc/path
with this,
verify(exactly(3), getRequestedFor(urlPathEqualTo("/abc/path")));
and its failing with an error saying that there are 4 events with the same path and not 3.
This was working with out any issue now as part of spring boot 3 migration task I have updated few libraries and it started failing.Lee Turner
09/19/2024, 12:46 PMRKK
09/19/2024, 12:47 PMRKK
09/19/2024, 12:59 PMRKK
09/19/2024, 1:00 PMinsertionIndex=1
and stubMapping
idRKK
09/19/2024, 1:31 PMRKK
09/19/2024, 2:24 PMLee Turner
09/19/2024, 2:24 PMRKK
09/19/2024, 2:25 PMRKK
09/19/2024, 2:26 PMLee Turner
09/19/2024, 2:30 PMRKK
09/19/2024, 2:35 PMLee Turner
09/19/2024, 2:36 PM