ResponseEntity provides static "notFound()" convenience method as well
Issue: SPR-12070
This commit is contained in:
@@ -20,9 +20,13 @@ import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Arjen Poutsma
|
||||
*/
|
||||
public class ResponseEntityTests {
|
||||
|
||||
@Test
|
||||
@@ -97,6 +101,15 @@ public class ResponseEntityTests {
|
||||
assertNull(responseEntity.getBody());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notFound() throws URISyntaxException {
|
||||
ResponseEntity<Void> responseEntity = ResponseEntity.notFound().build();
|
||||
|
||||
assertNotNull(responseEntity);
|
||||
assertEquals(HttpStatus.NOT_FOUND, responseEntity.getStatusCode());
|
||||
assertNull(responseEntity.getBody());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void headers() throws URISyntaxException {
|
||||
String eTag = "\"foo\"";
|
||||
|
||||
Reference in New Issue
Block a user