protected void expectPut4xxResponseBody(String invalidProp) { Response putResponse = expectPut4xxStatus(invalidProp); assertThat(putResponse.body().asString(), not(isEmptyOrNullString())); }
@Test @InSequence(0) public void shouldNotBeAbleToLocateAttachmentRoot() throws Exception { given(). then(). contentType(BASE_MEDIA_TYPE). statusCode(Status.OK.getStatusCode()). root("root"). body("link.find {it.@rel == 'attachment'}.size()", equalTo(0)). when(). get(new URL(base, "api/").toExternalForm()). body(); }
@Test @InSequence(0) public void shouldNotBeAbleToLocateUserRoot() throws Exception { given(). then(). contentType(BASE_MEDIA_TYPE). statusCode(Status.OK.getStatusCode()). root("root"). body("link.find {it.@rel == 'user'}.size()", equalTo(0)). when(). get(new URL(base, "api/").toExternalForm()). body(); }
@Test @InSequence(0) public void shouldBeAbleToLocateConferenceRoot() throws Exception { //uri_conference = new URL(base, "api/conference").toExternalForm(); uri_conference = given(). then(). contentType(BASE_MEDIA_TYPE). statusCode(Status.OK.getStatusCode()). root("root"). body("link.find {it.@rel == 'conference'}.size()", equalTo(1)). when(). get(new URL(base, "api/").toExternalForm()). body(). path("root.link.find {it.@rel == 'conference'}.@href"); }
.when() .get(response.getHeader(LOCATION)) .body().asByteArray(); assertEquals(expectedMD5, HashUtils.md5sum(binary), "md5sum"); } finally {
@Test @InSequence(2) public void shouldBeAbleToGetAttachment() throws Exception { assertNotNull("Previous step failed", uri_attachmentInstance); given(). then(). contentType(ATTACHMENT_MEDIA_TYPE). statusCode(Status.OK.getStatusCode()). when(). get(uri_attachmentInstance). body(). path("attachment.link.find {it.@rel == 'session'}.@href"); }
@Test @InSequence(2) public void shouldBeAbleToGetConference() throws Exception { assertNotNull("Previous step failed", uri_conferenceInstance); uri_session = given(). then(). contentType(CONFERENCE_MEDIA_TYPE). statusCode(Status.OK.getStatusCode()). root("conference"). body("link.find {it.@rel == 'bookmark'}.size()", equalTo(1)). body("link.find {it.@rel == 'self'}.size()", equalTo(1)). when(). get(uri_conferenceInstance). body(). path("conference.link.find {it.@rel == 'session'}.@href"); }
.contentType(TEXT_TURTLE) .get(container) .body().as(Model.class, new RdfObjectMapper(container));
@Override public void perform() { responseValidation( given(). then(). contentType(getTypedMediaType()) , domain). when(). get(createRootURL() + "/{id}", domain.getId()). body(); } }).inspect(new SetupRepository<DOMAIN>(getDomainClass(), domain));
String field = exp[0]; String validation = exp[1]; assertTrue(CompareField.validate(response.body().prettyPrint(),field,validation), "failed: " + field + validation);
.when() .get(location) .body().asByteArray(); assertEquals(expectedMD5, HashUtils.md5sum(binary), "md5sum"); } finally {