Return 415 on bad request body content-type

Issue: SPR-10982
This commit is contained in:
Rossen Stoyanchev
2013-11-05 15:30:22 -05:00
parent 4b38dc8972
commit 2f13e05b4f
2 changed files with 18 additions and 4 deletions

View File

@@ -187,6 +187,12 @@ public class RequestResponseBodyMethodProcessorMockTests {
}
}
@Test(expected = HttpMediaTypeNotSupportedException.class)
public void resolveArgumentInvalidContentType() throws Exception {
this.servletRequest.setContentType("bad");
processor.resolveArgument(paramRequestBodyString, mavContainer, webRequest, null);
}
@Test
public void resolveArgumentNotRequiredNoContent() throws Exception {
servletRequest.setContent(null);