I'm trying to create a mock server using wire-mock and I'm facing the following problem: I want to hit an URL like this /customers?customerId={customerId}&customerNo={customerNo}
.
My question is how can I match the request parameters customerId
and customerNo
from the stub of the mock server in Java code.
EDIT
After the first response, this is the result:
EDIT 2
Here is my stub:
WireMockServer mockServer = new WireMockServer(8079);
mockServer.start();
mockServer.stubFor(get(urlEqualTo("/api/loan/admin/contracts"))
.withQueryParam("status", equalTo("ACTIVE"))
.withQueryParam("cnp", equalTo("1950503410033"))
.willReturn(aResponse().withBody("Welcome to Baeldung!")));