コード例 #1
0
 @Test
 public void addingPersonWithValidationErrors() {
   assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity(
       400,
       RESOURCE_UNDER_TEST_URI,
       POST_HTTP_METHOD,
       PersonRequestRepresentation.withValidationErrors());
 }
コード例 #2
0
 @Test
 public void addingExistingPersonExistingSoRRecord() {
   assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity(
       409,
       RESOURCE_UNDER_TEST_URI,
       POST_HTTP_METHOD,
       PersonRequestRepresentation.forExistingPersonExistingSoRRecord());
 }
コード例 #3
0
 @Test
 public void addingPersonWithMultiplePeopleFound() {
   assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity(
       409,
       RESOURCE_UNDER_TEST_URI,
       POST_HTTP_METHOD,
       PersonRequestRepresentation.forMultiplePeople());
 }
コード例 #4
0
 @Test
 public void addingNonExistentPerson() {
   assertNotNull(
       assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntity(
               201,
               RESOURCE_UNDER_TEST_URI,
               POST_HTTP_METHOD,
               PersonRequestRepresentation.forNewPerson())
           .getHeaders()
           .getFirst("Location"));
 }
コード例 #5
0
 @Test
 public void forceAddingPersonWithMultiplePeopleFound() {
   assertNotNull(
       assertStatusCodeEqualsForRequestUriAndHttpMethodAndEntityWithQueryParam(
               201,
               RESOURCE_UNDER_TEST_URI,
               POST_HTTP_METHOD,
               PersonRequestRepresentation.forMultiplePeople(),
               "force",
               "y")
           .getHeaders()
           .getFirst("Location"));
 }