use of io.restassured.specification.RequestSpecification in project rest-assured by rest-assured.
the class SpecificationBuilderITest method supportsSpecifyingParametersInRequestSpecBuilder.
@Test
public void supportsSpecifyingParametersInRequestSpecBuilder() throws Exception {
final RequestSpecification spec = new RequestSpecBuilder().addParameter("firstName", "John").addParam("lastName", "Doe").build();
given().spec(spec).expect().body("greeting.firstName", equalTo("John")).body("greeting.lastName", equalTo("Doe")).when().get("/greetXML");
}
use of io.restassured.specification.RequestSpecification in project rest-assured by rest-assured.
the class SpecificationBuilderITest method supportsMergingMultiValueFormParametersWhenUsingRequestSpecBuilder.
@Test
public void supportsMergingMultiValueFormParametersWhenUsingRequestSpecBuilder() throws Exception {
final RequestSpecification spec = new RequestSpecBuilder().addFormParam("list", "1", "2", "3").build();
given().spec(spec).expect().body("list", equalTo("1,2,3")).when().put("/multiValueParam");
}
use of io.restassured.specification.RequestSpecification in project rest-assured by rest-assured.
the class SpecificationBuilderITest method supportsMergingMultiValueFormParametersUsingListWhenUsingRequestSpecBuilder.
@Test
public void supportsMergingMultiValueFormParametersUsingListWhenUsingRequestSpecBuilder() throws Exception {
final RequestSpecification spec = new RequestSpecBuilder().addFormParam("list", asList("1", "2", "3")).build();
given().spec(spec).expect().body("list", equalTo("1,2,3")).when().put("/multiValueParam");
}
use of io.restassured.specification.RequestSpecification in project rest-assured by rest-assured.
the class SpecificationBuilderITest method supportsSpecifyingQueryParametersInRequestSpecBuilderWhenGet.
@Test
public void supportsSpecifyingQueryParametersInRequestSpecBuilderWhenGet() throws Exception {
final RequestSpecification spec = new RequestSpecBuilder().addQueryParameter("firstName", "John").addQueryParam("lastName", "Doe").build();
given().spec(spec).expect().body("greeting.firstName", equalTo("John")).body("greeting.lastName", equalTo("Doe")).when().get("/greetXML");
}
use of io.restassured.specification.RequestSpecification in project rest-assured by rest-assured.
the class SSLITest method allows_specifying_trust_store_statically_with_request_builder.
@Test
public void allows_specifying_trust_store_statically_with_request_builder() throws Exception {
// Load the trust store
InputStream trustStoreStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("jetty_localhost_client.jks");
KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
trustStore.load(trustStoreStream, "test1234".toCharArray());
// Set the truststore on the global config
RestAssured.config = RestAssured.config().sslConfig(SSLConfig.sslConfig().trustStore(trustStore).and().allowAllHostnames());
final RequestSpecification spec = new RequestSpecBuilder().build();
RestAssured.given().spec(spec).get("https://localhost:8443/hello").then().spec(helloWorldSpec());
}
Aggregations