diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java index a99dfcbf072..84f81d7138a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java @@ -50,8 +50,8 @@ import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolv * *
An {@code @RequestBody} method argument is also validated if it is annotated
* with {@code @javax.validation.Valid}. In case of validation failure,
- * {@link MethodArgumentNotValidException} is raised and results in a 400 response
- * status code if {@link DefaultHandlerExceptionResolver} is configured.
+ * {@link MethodArgumentNotValidException} is raised and results in an HTTP 400
+ * response status code if {@link DefaultHandlerExceptionResolver} is configured.
*
* @author Arjen Poutsma
* @author Rossen Stoyanchev
@@ -114,7 +114,7 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter
protected Also see {@link RequestResponseBodyMethodProcessorMockTests}.
*
@@ -177,9 +177,7 @@ public class RequestResponseBodyMethodProcessorTests {
assertEquals("foobarbaz", result);
}
- // SPR-9942
-
- @Test(expected = HttpMessageNotReadableException.class)
+ @Test(expected = HttpMessageNotReadableException.class) // SPR-9942
public void resolveArgumentRequiredNoContent() throws Exception {
this.servletRequest.setContent(new byte[0]);
this.servletRequest.setContentType("text/plain");
@@ -189,9 +187,7 @@ public class RequestResponseBodyMethodProcessorTests {
processor.resolveArgument(paramString, mavContainer, webRequest, binderFactory);
}
- // SPR-9964
-
- @Test
+ @Test // SPR-9964
public void resolveArgumentTypeVariable() throws Exception {
Method method = MyParameterizedController.class.getMethod("handleDto", Identifiable.class);
HandlerMethod handlerMethod = new HandlerMethod(new MySimpleParameterizedController(), method);
@@ -211,9 +207,7 @@ public class RequestResponseBodyMethodProcessorTests {
assertEquals("Jad", result.getName());
}
- // SPR-11225
-
- @Test
+ @Test // SPR-11225
public void resolveArgumentTypeVariableWithNonGenericConverter() throws Exception {
Method method = MyParameterizedController.class.getMethod("handleDto", Identifiable.class);
HandlerMethod handlerMethod = new HandlerMethod(new MySimpleParameterizedController(), method);
@@ -235,9 +229,7 @@ public class RequestResponseBodyMethodProcessorTests {
assertEquals("Jad", result.getName());
}
- // SPR-9160
-
- @Test
+ @Test // SPR-9160
public void handleReturnValueSortByQuality() throws Exception {
this.servletRequest.addHeader("Accept", "text/plain; q=0.5, application/json");
@@ -346,9 +338,7 @@ public class RequestResponseBodyMethodProcessorTests {
assertFalse(content.contains("\"withoutView\":\"without\""));
}
- // SPR-12149
-
- @Test
+ @Test // SPR-12149
public void jacksonJsonViewWithResponseBodyAndXmlMessageConverter() throws Exception {
Method method = JacksonViewController.class.getMethod("handleResponseBody");
HandlerMethod handlerMethod = new HandlerMethod(new JacksonViewController(), method);