spring-5-mvc (#1952)
This commit is contained in:
@@ -16,14 +16,14 @@ public class LiveTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void givenUser_whenPostWithNullName_then400BadRequest() {
|
||||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceWithNullName()).post(APP_ROOT + "/user");
|
||||
public void givenUser_whenResourceCreatedWithNullName_then400BadRequest() {
|
||||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceWithNullName()).post(APP_ROOT + "/foos");
|
||||
assertEquals(400, response.getStatusCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenUser_whenResourceCreated_then201Created() {
|
||||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceString()).post(APP_ROOT + "/user");
|
||||
final Response response = givenAuth("user", "pass").contentType(MediaType.APPLICATION_JSON.toString()).body(resourceString()).post(APP_ROOT + "/foos");
|
||||
assertEquals(201, response.getStatusCode());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user