Fix broken endpoint integration tests
Ensure that JSON response is returned when extracting data from the error details. See gh-12513
This commit is contained in:
@@ -168,7 +168,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
|
||||
public void readOperationWithMappingFailureProducesBadRequestResponse() {
|
||||
load(QueryEndpointConfiguration.class, (client) -> {
|
||||
WebTestClient.BodyContentSpec body = client.get().uri("/query?two=two")
|
||||
.exchange().expectStatus().isBadRequest().expectBody();
|
||||
.accept(MediaType.APPLICATION_JSON).exchange().expectStatus()
|
||||
.isBadRequest().expectBody();
|
||||
validateErrorBody(body, HttpStatus.BAD_REQUEST, "/endpoints/query",
|
||||
"Missing parameters: one");
|
||||
});
|
||||
@@ -290,7 +291,8 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
|
||||
public void readOperationWithMissingRequiredParametersReturnsBadRequestResponse() {
|
||||
load(RequiredParameterEndpointConfiguration.class, (client) -> {
|
||||
WebTestClient.BodyContentSpec body = client.get().uri("/requiredparameters")
|
||||
.exchange().expectStatus().isBadRequest().expectBody();
|
||||
.accept(MediaType.APPLICATION_JSON).exchange().expectStatus()
|
||||
.isBadRequest().expectBody();
|
||||
validateErrorBody(body, HttpStatus.BAD_REQUEST,
|
||||
"/endpoints/requiredparameters", "Missing parameters: foo");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user