@Test @InSequence(1) public void shouldBeAbleToCreateAttachment() throws Exception { // Attachment is not a top level resource, so in the test we hardcode the known location uri_attachment = new URL(base, "api/attachment").toExternalForm(); AttachmentType conf = getCreateAttachment(); uri_attachmentInstance = given(). contentType(ATTACHMENT_MEDIA_TYPE). body(conf). then(). statusCode(Status.CREATED.getStatusCode()). when(). post(uri_attachment). header("Location"); }
@Test @InSequence(1) public void shouldBeAbleToCreateUser() throws Exception { // User is not a top level resource, so in the test we hardcode the known location uri_user = new URL(base, "api/user").toExternalForm(); UserType conf = getCreateUser(); uri_userInstance = given(). contentType(USER_MEDIA_TYPE). body(conf). then(). statusCode(Status.CREATED.getStatusCode()). when(). post(uri_user). header("Location"); }
)); } finally { buildBaseRequestSpecification().delete(postResponse.header(LOCATION));
@Test @InSequence(1) public void shouldBeAbleToCreateConference() throws Exception { assertNotNull("Previous step failed", uri_conference); ConferenceType conf = getCreateConference(); uri_conferenceInstance = given(). contentType(CONFERENCE_MEDIA_TYPE). body(conf). then(). statusCode(Status.CREATED.getStatusCode()). when(). post(uri_conference). header("Location"); }
@Test @InSequence(5) public void shouldBeAbleToCreateSession() throws Exception { assertNotNull("Previous step failed", uri_session); SessionType session = getCreateSession(); uri_sessionInstance = given(). contentType(SESSION_MEDIA_TYPE). body(session). then(). statusCode(Status.CREATED.getStatusCode()). when(). post(uri_session). header("Location"); }