I'm trying to do this:
stubFor(get("/my/path")
.withQueryParam("paramName", matching(format("^(%s)|(%s)|(%s)$", v1, v2, v3)))
.willReturn(okJson(RESPONSE)));
and I get this error:
GET | GET
/my/path | /my/path?paramName=v1Value <<<<< URL does not match
|
Query: paramName [matches] ^(v1Value)|(v2Value)|(v3Value)$ | paramName: v1Value
I have tested the regex and it works. I also debugged and I saw that the RegexPattern also matches. But for some reason, I still get this error. I believe I'm using it wrongly.
I tried a simpler version that also didn't work:
stubFor(get("/my/path")
.withQueryParam("paramName", equalTo("v1Value"))
.willReturn(okJson(RESPONSE)));
Any ideas? Thanks in advance.