use of com.jayway.restassured.specification.RequestSpecification in project nakadi by zalando.
the class RealEnvironmentAT method requestSpec.
protected RequestSpecification requestSpec() {
final RequestSpecification requestSpec = given();
oauthToken.ifPresent(token -> requestSpec.header("Authorization", "Bearer " + token));
return requestSpec;
}
use of com.jayway.restassured.specification.RequestSpecification in project camunda-bpm-platform by camunda.
the class TenantRestServiceQueryTest method completeGetParameters.
@Test
public void completeGetParameters() {
Map<String, String> queryParameters = getCompleteStringQueryParameters();
RequestSpecification requestSpecification = given().contentType(POST_JSON_CONTENT_TYPE);
for (Entry<String, String> paramEntry : queryParameters.entrySet()) {
requestSpecification.parameter(paramEntry.getKey(), paramEntry.getValue());
}
requestSpecification.expect().statusCode(Status.OK.getStatusCode()).when().get(QUERY_URL);
verify(mockQuery).tenantId(MockProvider.EXAMPLE_TENANT_ID);
verify(mockQuery).tenantName(MockProvider.EXAMPLE_TENANT_NAME);
verify(mockQuery).tenantNameLike("%" + MockProvider.EXAMPLE_TENANT_NAME + "%");
verify(mockQuery).userMember(MockProvider.EXAMPLE_USER_ID);
verify(mockQuery).groupMember(MockProvider.EXAMPLE_GROUP_ID);
verify(mockQuery).list();
}
use of com.jayway.restassured.specification.RequestSpecification in project structr by structr.
the class RestCommand method request.
protected RequestSpecification request(final Console console) {
final RequestSpecification req = RestAssured.given();
final String usernameFromAuth = console.getUsername();
final String passwordFromAuth = console.getPassword();
req.accept(ContentType.JSON);
if (StringUtils.isNoneBlank(username, password)) {
req.header("X-User", username);
req.header("X-Password", password);
} else if (StringUtils.isNoneBlank(usernameFromAuth, passwordFromAuth)) {
req.header("X-User", usernameFromAuth);
req.header("X-Password", passwordFromAuth);
}
return req;
}
Aggregations