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 7bf4324f0f
commit 18b69903ca
2 changed files with 15 additions and 1 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);