Hello everyone. I want to make mapping for my wi...
# help
t
Hello everyone. I want to make mapping for my wiremock server. However I have no idea how to map char array instead of string.
Copy code
"request": {
    "urlPathPattern": "/some/url",
    "method": "GET",
    "headers" : {
      "apiKey": {
        "equalTo": "test"
      }
    }

  }
This mapping will stub for string 'test' but i wanna match it to char. The result would be apiKey [matches] : test | apiKey: [t, e, s, t] <<<<< Header does not match
Copy code
Putting in the mapping  "equalTo": "test"
, ends up with initializationError -> equalTo operand must be a non-null string I tried different options like 'matches' but nothing works. I get char array in header and I cannot change it. How can I stub it?
l
Sorry, I am not sure I understand your requirement here. Is it that you want to match a request with a header of
apiKey: [t,e,s,t]
t
Yup, exactly. I'll have a key with value "test".toCharArray(), so it should match ["t","e","s","t"] the only idea I have come up with would be to use matcher like "value": { "matches": "^(.*[\"t\",\"e\",\"s\",\"t\"]])" } but it looks like a workaround. Or would it be proper solution?
j
Out of interest, what problem are you trying to solve here?