File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
main/java/org/springframework/http
test/java/org/springframework/http Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ public static HeadersBuilder<?> notFound() {
252
252
* @return the created builder
253
253
* @since 4.1.3
254
254
*/
255
- public static HeadersBuilder <?> unprocessableEntity () {
255
+ public static BodyBuilder unprocessableEntity () {
256
256
return status (HttpStatus .UNPROCESSABLE_ENTITY );
257
257
}
258
258
Original file line number Diff line number Diff line change @@ -122,11 +122,11 @@ public void notFound() throws URISyntaxException {
122
122
123
123
@ Test
124
124
public void unprocessableEntity () throws URISyntaxException {
125
- ResponseEntity <Void > responseEntity = ResponseEntity .unprocessableEntity ().build ( );
125
+ ResponseEntity <String > responseEntity = ResponseEntity .unprocessableEntity ().body ( "error" );
126
126
127
127
assertNotNull (responseEntity );
128
128
assertEquals (HttpStatus .UNPROCESSABLE_ENTITY , responseEntity .getStatusCode ());
129
- assertNull ( responseEntity .getBody ());
129
+ assertEquals ( "error" , responseEntity .getBody ());
130
130
}
131
131
132
132
@ Test
You can’t perform that action at this time.
0 commit comments