@Test public void addingPersonWithValidationErrors() { assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity( 400, RESOURCE_UNDER_TEST_URI, POST_HTTP_METHOD, PersonRequestRepresentation.withValidationErrors()); }
@Test public void addingExistingPersonExistingSoRRecord() { assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity( 409, RESOURCE_UNDER_TEST_URI, POST_HTTP_METHOD, PersonRequestRepresentation.forExistingPersonExistingSoRRecord()); }
@Test public void addingPersonWithMultiplePeopleFound() { assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity( 409, RESOURCE_UNDER_TEST_URI, POST_HTTP_METHOD, PersonRequestRepresentation.forMultiplePeople()); }
@Test public void addingNonExistentPerson() { assertNotNull( assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity( 201, RESOURCE_UNDER_TEST_URI, POST_HTTP_METHOD, PersonRequestRepresentation.forNewPerson()) .getHeaders() .getFirst("Location")); }
@Test public void forceAddingPersonWithMultiplePeopleFound() { assertNotNull( assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntityWithQueryParam( 201, RESOURCE_UNDER_TEST_URI, POST_HTTP_METHOD, PersonRequestRepresentation.forMultiplePeople(), "force", "y") .getHeaders() .getFirst("Location")); }