First of all, none of the above URL works. & its so freaking difficult to use this framework.. none of the API has proper documentation and also bloody when some thing does not work, it does not give proper error message also.
In my case, I have been trying to send a Request Parameter called "business-date" which expects a date with format "yyyy-MM-dd" and none of the below options seems to be working --
matchQuery("business-date", "\\d{4}-\\d{2}-\\d{2}", "2020-05-18")
query("business-date="+getBusinessDate())
queryMatchingDate("business-date", "yyyy-MM-dd")
matchQuery("business-date", "\\d{4}-\\d{2}-\\d{2}")
queryMatchingDate("business-date", "yyyy-MM-dd")
queryMatchingISODate("business-date", "yyyy-MM-dd")
The exception looks like this
org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Internal Server Error: [{ "error": "Unexpected request : \tmethod: GET\n\tpath: \/api\/batch_activities\/ACTIVITY\/STARTED\n\tquery: {}\n\theaders: {X-b3-traceid=[6c88f0a1a0ae288e], Accept=[application\/json], Connection=[ke... (443 bytes)]
Caused by: org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Internal Server Error: [{ "error": "Unexpected request : \tmethod: GET\n\tpath: \/api\/batch_activities\/ACTIVITY\/STARTED\n\tquery: {}\n\theaders: {X-b3-traceid=[6c88f0a1a0ae288e], Accept=[application\/json], Connection=[ke... (443 bytes)]
Once instance of the DSL looks like below -
builder.given("Fetch Batch Activity by status")
.uponReceiving("Receiving Batch activity status").headers(headers).method(HttpMethod.GET)
.matchPath(pathRegex, path)
.matchQuery("business-date", "\\d{4}-\\d{2}-\\d{2}")
.willRespondWith().status(200).headers(headers).body(jsonUtil.getObjectAsString(
formatBatchActivityForStatus(FeedExporterConstants.BATCH_STATUS_STARTED)))
.toPact();