Hi Team, I'm struggeling with the WireMockExtensi...
# wiremock-java
o
Hi Team, I'm struggeling with the WireMockExtension and stubbing. I try to stub a json response with:
Copy code
stubFor(get(urlPathMatching(requestPath))
    .withQueryParam("deleted", equalTo("false"))
    .willReturn(okJson(machineResponseBody())));
But the result is: Caused by: org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type 'text/plain;charset=UTF-8' Seems wiremock is responding with PLAIN_TEXT instead of APPLICATION_JSON.
After some debugging I have extracted the text response: Request was not matched ======================= ----------------------------------------------------------------------------------------------------------------------- | Closest stub | Request | ----------------------------------------------------------------------------------------------------------------------- | GET | GET [path] | /V1/organizations/1dd1a68a-606b-479f-a9fd-f0e0417ba201/ma<<<<< URL does not match /v1/organizations/1dd1a68a-606b-479f-a9fd-f0e0417ba201/ma | chines/4b6bbb21-2693-4542-9385-c7ba47355531?deleted=false chines/4b6bbb21-2693-4542-9385-c7ba47355531 | | Query: deleted = false | deleted: false | | -----------------------------------------------------------------------------------------------------------------------
The big question is, what's wrong with my query param? Fun fact, the same stubbing was working with the old wiremock server setup.
omg I found it! V1 != v1!
Sorry
👍 2