use of org.springframework.http.MediaType.APPLICATION_JSON in project spring-framework by spring-projects.
the class DispatcherHandlerErrorTests method responseBodyMessageConversionError.
@Test
public void responseBodyMessageConversionError() {
ServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.post("/request-body").accept(APPLICATION_JSON).body("body"));
Mono<Void> publisher = this.dispatcherHandler.handle(exchange);
StepVerifier.create(publisher).consumeErrorWith(error -> assertThat(error).isInstanceOf(NotAcceptableStatusException.class)).verify();
}
Aggregations