Skip to content

Commit cf5eefd

Browse files
committed
Add test shouldKeepProduceMediaTypesOrder
1 parent d9445bb commit cf5eefd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spring-web/src/test/java/org/springframework/web/method/annotation/ExceptionHandlerMethodResolverTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ void shouldResolveMethodWithMediaType() {
117117
assertThat(resolver.resolveExceptionMapping(new IllegalArgumentException(), MediaType.TEXT_HTML).getHandlerMethod().getName()).isEqualTo("handleHtml");
118118
}
119119

120+
@Test
121+
void shouldKeepProduceMediaTypesOrder() {
122+
ExceptionHandlerMethodResolver resolver = new ExceptionHandlerMethodResolver(MediaTypeController.class);
123+
assertThat(resolver.resolveExceptionMapping(new IllegalArgumentException(), MediaType.TEXT_HTML).getProducibleTypes().toString()).isEqualTo("[text/html, */*]");
124+
}
125+
126+
120127
@Test
121128
void shouldResolveMethodWithCompatibleMediaType() {
122129
ExceptionHandlerMethodResolver resolver = new ExceptionHandlerMethodResolver(MediaTypeController.class);

0 commit comments

Comments
 (0)