spring-5-mvc (#1952)

This commit is contained in:
asif-anwar
2017-05-29 20:58:25 +04:00
committed by Eugen
parent fe841fe53b
commit 8f3039b292
3 changed files with 69 additions and 69 deletions

View File

@@ -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());
}