https://linen.dev logo
#help
Title
# help
j

JedrzejNowacki

02/28/2023, 2:41 PM
Hello everyone! I am trying to add some custom extensions, that would do matching for encrypted data without any artificial headers etc. All works fine, but after the request that i want to be matched, there comes another one (completely different url) that should be matched normally, without custom matcher. But my custom matcher kicks in as well in there. I filter out as noMatch any request that does not contain my parameters. I tried to debug and it looks like also the second call gets parameters, that are actually only configured for the 1st one! What can cause this behaviour? Here is the 1st request, that works fine
Copy code
"mappings": [
    {
      "request": {
        "urlPath": "/my-url",
        "method": "POST",
        "customMatcher" : {
          "name" : "encrypted-request-matcher",
          "parameters" : {
            "myParameter" : "someValueThatWillMatch"
          }
        },
This is 2nd one, that tries to match, but should not be even considered for matching.
Copy code
"mappings": [
    {
      "request": {
        "url": "/another-url",
        "method": "POST",
        "bodyPatterns": [
          {
            "equalToJson": {
              "data": {
                "type": "identifier",
                "attributes": {
                  "id": "1"
                }
              }
I put some debugs in custom matcher and it is clearly visible, that when wiremock attempts to match 2nd request (why would it even go through custom matcher?) it still holds the params from the 1st one! So "myParameter" : "someValueThatWillMatch" is still there. I use standalone wiremock instance.