Return 415 on bad request body content-type
Issue: SPR-10982
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user