提交 0524a82c 编写于 作者: R Rossen Stoyanchev

Update unprocessableEntity to allow body

Issue: SPR-12515
上级 33fca4e7
......@@ -252,7 +252,7 @@ public class ResponseEntity<T> extends HttpEntity<T> {
* @return the created builder
* @since 4.1.3
*/
public static HeadersBuilder<?> unprocessableEntity() {
public static BodyBuilder unprocessableEntity() {
return status(HttpStatus.UNPROCESSABLE_ENTITY);
}
......
......@@ -122,11 +122,11 @@ public class ResponseEntityTests {
@Test
public void unprocessableEntity() throws URISyntaxException {
ResponseEntity<Void> responseEntity = ResponseEntity.unprocessableEntity().build();
ResponseEntity<String> responseEntity = ResponseEntity.unprocessableEntity().body("error");
assertNotNull(responseEntity);
assertEquals(HttpStatus.UNPROCESSABLE_ENTITY, responseEntity.getStatusCode());
assertNull(responseEntity.getBody());
assertEquals("error", responseEntity.getBody());
}
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册