use of io.restassured.builder.ResponseSpecBuilder in project rest-assured by rest-assured.
the class SpecificationBuilderITest method bodyExpectationsAreNotOverwritten.
@Test
public void bodyExpectationsAreNotOverwritten() throws Exception {
final ResponseSpecBuilder builder = new ResponseSpecBuilder();
builder.expectBody("store.book.size()", is(4)).expectStatusCode(200);
final ResponseSpecification responseSpecification = builder.build();
expect().body("store.book.author", hasItems("Nigel Rees", "Evelyn Waugh", "Herman Melville", "J. R. R. Tolkien")).spec(responseSpecification).body("store.book[0].author", equalTo("Nigel Rees")).when().get("/jsonStore");
}
use of io.restassured.builder.ResponseSpecBuilder in project rest-assured by rest-assured.
the class SpecificationsDemoITest method demoResponseSpecification.
@Test
public void demoResponseSpecification() throws Exception {
final ResponseSpecification spec = new ResponseSpecBuilder().expectStatusCode(200).expectBody("responseType", equalTo("simple")).build();
given().param("name", "John Doe").expect().specification(spec).body("firstName", is("John")).body("lastName", is("Doe")).when().get("/demoResponseSpecification");
}
Aggregations