0

I have one wiremock test case which is being used for integration testing. Everything is good but I am stuck at place where I am generating HttpHeaders dynamically i.e. timestamp etc. Since I have to mention some dummy values in JSON File(like below). Can you please help me putting something there which will pass any string that is being generated in my code dynamically.

{
  "request": {
    "method": "GET",
    "url": "<SOME_URL>",
    "headers" : {
      "signature" : {
        "contains" : "some dynamically string"
      },
      "timestamp": {
        "contains" : "dynamic timestamp"
      },
      "traceid" : {
        "contains" :"dynamic alpha numeric string"
      }
    }
  },
  "response": {
    "status": 200,
    "jsonBody": {
        //Some response
    }
  }
}

1 Answer 1

0

Replaced my JSON with below REGEXs

"headers" : {
  "signature" : {
    "matches" : ".*some-always-present-chars.*"
  },
  "timestamp": {
    "matches" : "2.*"
  },
  "traceid" : {
    "matches" :".*"
  }
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.