use of com.jayway.restassured.path.json.JsonPath in project dataverse by IQSS.
the class UtilIT method getDataverseIdFromResponse.
static Integer getDataverseIdFromResponse(Response createDataverseResponse) {
JsonPath createdDataverse = JsonPath.from(createDataverseResponse.body().asString());
int dataverseId = createdDataverse.getInt("data.id");
logger.info("Id found in create dataverse response: " + createdDataverse);
return dataverseId;
}
use of com.jayway.restassured.path.json.JsonPath in project dataverse by IQSS.
the class UtilIT method getApiTokenFromResponse.
static String getApiTokenFromResponse(Response createUserResponse) {
JsonPath createdUser = JsonPath.from(createUserResponse.body().asString());
String apiToken = createdUser.getString("data." + API_TOKEN_KEY);
logger.info("API token found in create user response: " + apiToken);
return apiToken;
}
use of com.jayway.restassured.path.json.JsonPath in project dataverse by IQSS.
the class UtilIT method getAliasFromResponse.
static String getAliasFromResponse(Response createDataverseResponse) {
JsonPath createdDataverse = JsonPath.from(createDataverseResponse.body().asString());
String alias = createdDataverse.getString("data.alias");
logger.info("Alias found in create dataverse response: " + alias);
return alias;
}
use of com.jayway.restassured.path.json.JsonPath in project dataverse by IQSS.
the class FileRecordJobIT method getFaileJobJson.
/**
* A failed job is expected, get the json failure response
* @return
*/
private JsonPath getFaileJobJson() {
System.out.println("JOB API: " + props.getProperty("filesystem.api") + "/" + dsDoi);
JsonPath jsonPath = given().header(API_TOKEN_HTTP_HEADER, token).post(props.getProperty("filesystem.api") + "/" + dsDoi).then().assertThat().statusCode(400).extract().jsonPath();
return jsonPath;
}
use of com.jayway.restassured.path.json.JsonPath in project camunda-bpm-platform by camunda.
the class TaskRestServiceInteractionTest method verifyTaskAttachmentValues.
private void verifyTaskAttachmentValues(Attachment mockTaskAttachment, String responseContent, boolean urlExist) {
JsonPath path = from(responseContent);
String returnedId = path.get("id");
String returnedTaskId = path.get("taskId");
String returnedName = path.get("name");
String returnedType = path.get("type");
String returnedDescription = path.get("description");
String returnedUrl = path.get("url");
Attachment mockAttachment = mockTaskAttachments.get(0);
assertEquals(mockAttachment.getId(), returnedId);
assertEquals(mockAttachment.getTaskId(), returnedTaskId);
assertEquals(mockAttachment.getName(), returnedName);
assertEquals(mockAttachment.getType(), returnedType);
assertEquals(mockAttachment.getDescription(), returnedDescription);
if (urlExist) {
assertEquals(mockAttachment.getUrl(), returnedUrl);
}
}
Aggregations