use of org.springframework.web.reactive.accept.FixedContentTypeResolver in project spring-framework by spring-projects.
the class HandlerResultHandlerTests method usesContentTypeResolver.
@Test
public void usesContentTypeResolver() throws Exception {
TestResultHandler resultHandler = new TestResultHandler(new FixedContentTypeResolver(IMAGE_GIF));
List<MediaType> mediaTypes = Arrays.asList(IMAGE_JPEG, IMAGE_GIF, IMAGE_PNG);
MockServerWebExchange exchange = MockServerHttpRequest.get("/path").toExchange();
MediaType actual = resultHandler.selectMediaType(exchange, () -> mediaTypes);
assertEquals(IMAGE_GIF, actual);
}
Aggregations