I'm use 2.0.1.RELEASE.
I have response body
[
{
"id": "00000bb0b000b00000b0b000",
"name": "Admin test project 1"
},
{
"id": "11111bb1b111b11111b1b111",
"name": "Admin test project 2"
}
]
My contract in yaml
request:
method: GET
url: /projects
headers:
Content-Type: application/json;charset=UTF-8
response:
status: 200
headers:
Content-Type: application/json;charset=UTF-8
matchers:
body:
- path: $[0].id
type: by_regex
value: "[0-9a-z]{24}"
- path: $[1].id
type: by_regex
value: "[0-9a-z]{24}"
The generated ContractVerifierTest don't has matchers part
// given:
MockMvcRequestSpecification request = given()
.header("Content-Type", "application/json;charset=UTF-8");
// when:
ResponseOptions response = given().spec(request)
.get("/projects");
// then:
assertThat(response.statusCode()).isEqualTo(200);
assertThat(response.header("Content-Type")).isEqualTo("application/json;charset=UTF-8");
It will be good if matchers section will be generated even if no body section, since in this situation I have anonymous array with dynamic data that can't be verified in body section.
I'm use
2.0.1.RELEASE.I have response body
My contract in
yamlThe generated
ContractVerifierTestdon't hasmatcherspartIt will be good if
matcherssection will be generated even if nobodysection, since in this situation I have anonymous array with dynamic data that can't be verified inbodysection.