another question: I am trying to match my request ...
# help
k
another question: I am trying to match my request using bodyPatterns - matchesXPath. But I am getting Warning: failed to evaluate the XPath expression
t
Can you share the expression and an example of the XML you want to match?
k
For brevity, this is the part that is important
<ns2:Body><ns3:pe><ns3:ct><ns3:cd>00600</ns3:ct><ns3:cp>64</ns3:cp><ns3:cuob>25</ns3:cuob></ns3:ct><ns3:pe><ns3:ntp>239001417</ns3:ntp><ns3:ib><ns3:cu>25</ns3:cu><ns3:ci>2896300080021</ns3:ci>
I want to match the ci
"bodyPatterns": [ { "matchesXPath": "//ns3:ci/text()='0829004593005'" } ]
What I intended: if the url matches, and the body matches the expression, use this mapping
the number in ci, will change depending on my test case
is my expression wrong?
I also tried "matchesXPath": "//ci[text() = '2896300080021']"
but it did not work
t
/Body/pe/ib/ci[text()='2896300080021']
worked for me. Still investigating whey the wildcard didn’t work.
k
will try that
It almost worked. There is something weird. If I shutdown the wiremock docker container, bring it up again, and run only this test, it works. If I do the same but run all my test suite with mvn test the test fails