I've been using the "equalToJson" for bodypatterns matching, and in most cases, that did exactly what I want. However, I ran into a case in which part of the incoming bodypattern contains unknown data. In searching around, I didn't see a way to use wildcards with the equalToJson parameter, so I instead tried 3 different options that seems to work (sort of) for me:
"matchesJsonPath" : "[?(@.username == 'qapp-0923-ssomyl')]",
"matchesJsonPath" : "$.password"
"matches" : ".*username.*",
"matches" : ".*password.*"
"contains": "username",
"contains": "password"
Of those 3 sets, the 1st set is the most desirable implementation that I'd like to use, but I have a common problem in all 3 cases. The problem is that whichever parameter is listed last seems to be the only parameter that matters when it comes to wiremock considering the request to be a match. For example, in the 3 sets above, I can change "username" to "XXX", but leave "password" as is in my request and wiremock still considers my request to be a match. How do I link these parameters together so wiremock only considers a match to have occurred if ALL name/value pairs are present/correct?
Thanks,
Jason