com.jayway.restassured.response.Response.body()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中com.jayway.restassured.response.Response.body方法的一些代码示例,展示了Response.body的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.body方法的具体详情如下:
包路径:com.jayway.restassured.response.Response
类名称:Response
方法名:body

Response.body介绍

暂无

代码示例

代码示例来源:origin: org.w3/ldp-testsuite

protected void expectPut4xxResponseBody(String invalidProp) {
  Response putResponse = expectPut4xxStatus(invalidProp);
  assertThat(putResponse.body().asString(), not(isEmptyOrNullString()));
}

代码示例来源:origin: arquillian/continuous-enterprise-development

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

代码示例来源:origin: arquillian/continuous-enterprise-development

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

代码示例来源:origin: arquillian/continuous-enterprise-development

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

代码示例来源:origin: org.w3/ldp-testsuite

.when()
      .get(response.getHeader(LOCATION))
      .body().asByteArray();
  assertEquals(expectedMD5, HashUtils.md5sum(binary), "md5sum");
} finally {

代码示例来源:origin: arquillian/continuous-enterprise-development

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

代码示例来源:origin: arquillian/continuous-enterprise-development

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

代码示例来源:origin: org.w3/ldp-testsuite

.contentType(TEXT_TURTLE)
.get(container)
  .body().as(Model.class, new RdfObjectMapper(container));

代码示例来源:origin: arquillian/continuous-enterprise-development

@Override
  public void perform() {
    responseValidation(
      given().
      then().
        contentType(getTypedMediaType())
    , domain).
    when().
      get(createRootURL() + "/{id}", domain.getId()).
    body();
  }
}).inspect(new SetupRepository<DOMAIN>(getDomainClass(), domain));

代码示例来源:origin: tote/restng8

String field = exp[0];
String validation = exp[1];
assertTrue(CompareField.validate(response.body().prettyPrint(),field,validation), "failed: " + field + validation);

代码示例来源:origin: org.w3/ldp-testsuite

.when()
      .get(location)
      .body().asByteArray();
  assertEquals(expectedMD5, HashUtils.md5sum(binary), "md5sum");
} finally {

相关文章