Hi Team, I need a help. I see the responseDefinition is being applied to all the incoming request when defined. Is it normal?. When I create a simple stubs it works fine and when I create an extended stub with response transformer inside the same mapping folder, the extended stub works fine but the hello stub stops working and if I remove the extension(from command line) then the hello stub works but not the extension. The issue I see is when I enabled extension all my requests are first processed by(or sent) to the extension responder rather than the url based checking. Below are the details.
{
"request" : {
"url" : "/hello",
"method" : "GET"
},
"response" : {
"status" : 200,
"body" : "hello world",
"headers" : {
"Content-Type" : "application/json;charset=utf-8",
"Date" : "Fri, 05 May 2023 13:22:14 GMT"
}
}
}
Extented code
{
"id" : "9e4f8ca4-23f1-4e7a-b078-8c1a9cbca156",
"name" : "buyinghistory",
"request" : {
"urlPath" : "/buyinghistory",
"method" : "GET",
"queryParameters": {
"start": {
"matches": "^[0-9]{2}/[0-9]{2}/[0-9]{4}$"
},
"stop": {
"matches": "^[0-9]{2}/[0-9]{2}/[0-9]{4}$"
}
},
"customMatcher":{
"name": "date-range",
"parameters": {
"maxLength": 0
}
}
},
"response" : {
"status" : 200,
"headers" : {
"Content-Type" : "text/plain;charset=UTF-8",
"Keep-Alive" : "timeout=60"
},
"transformers": ["buying-history"]
},
"uuid" : "9e4f8ca4-23f1-4e7a-b078-8c1a9cbca156",
}
java -cp "wiremock-standalone-2.35.0.jar:wiremock-body-transformer-1.0.2.jar" com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --extension com.test.extension.QueryDateRange,com.test.extension.BuyingHistory --local-response-templating --verbose