use of com.jayway.restassured.path.json.JsonPath in project camunda-bpm-platform by camunda.
the class DeploymentRestServiceInteractionTest method verifyDmnDeploymentValues.
private void verifyDmnDeploymentValues(Deployment mockDeployment, String responseContent) {
JsonPath path = from(responseContent);
verifyStandardDeploymentValues(mockDeployment, path);
Map<String, HashMap<String, Object>> deployedDecisionDefinitions = path.getMap(PROPERTY_DEPLOYED_DECISION_DEFINITIONS);
assertEquals(1, deployedDecisionDefinitions.size());
HashMap decisionDefinitionDto = deployedDecisionDefinitions.get(EXAMPLE_DECISION_DEFINITION_ID);
assertNotNull(decisionDefinitionDto);
verifyDmnDeployment(decisionDefinitionDto);
assertNull(path.get(PROPERTY_DEPLOYED_DECISION_REQUIREMENTS_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_PROCESS_DEFINITIONS));
assertNull(path.get(PROPERTY_DEPLOYED_CASE_DEFINITIONS));
}
use of com.jayway.restassured.path.json.JsonPath in project camunda-bpm-platform by camunda.
the class DeploymentRestServiceInteractionTest method verifyDeploymentValues.
private void verifyDeploymentValues(Deployment mockDeployment, String responseContent) {
JsonPath path = from(responseContent);
verifyStandardDeploymentValues(mockDeployment, path);
}
use of com.jayway.restassured.path.json.JsonPath in project kylo by Teradata.
the class SearchFeedMetadataEsIT method verifyIndexDocCompleteness.
private void verifyIndexDocCompleteness(String feedId) {
String docId = getDocIdForIndexedFeedMetadata(feedId);
Response response = RestAssured.get(getBaseEsUrl() + FEEDS_INDEX_PREFIX + "-" + WORKSPACE + "/" + FEEDS_DOCTYPE + "/" + docId);
response.then().assertThat().body(matchesJsonSchemaInClasspath(FEEDS_SEARCH_RESULT_SCHEMA_JSON_PATH));
String responseJson = response.asString();
JsonPath responseJsonPath = new JsonPath(responseJson);
getIndexedFieldsWithJsonPathForEntity().forEach(field -> Assert.assertNotNull(responseJsonPath.get(field)));
}
use of com.jayway.restassured.path.json.JsonPath in project data-prep by Talend.
the class SuggestionTest method suggestLimit.
@Test
public void suggestLimit() throws Exception {
// given
final String columnMetadata = IOUtils.toString(Application.class.getResourceAsStream("suggestions/date_column.json"), UTF_8);
// when
final String response = //
given().contentType(//
JSON).body(//
columnMetadata).when().post(//
"/suggest/column?limit=2").asString();
// then
final JsonPath json = JsonPath.from(response);
assertThat(json.getList("").size(), is(2));
}
use of com.jayway.restassured.path.json.JsonPath in project data-prep by Talend.
the class DataSetAPITest method testDataSetDeleteWhenUsedByPreparation.
/**
* DataSet deletion test case when the dataset is used by a preparation.
*/
@Test
public void testDataSetDeleteWhenUsedByPreparation() throws Exception {
// given
final String dataSetId = testClient.createDataset("dataset/dataset.csv", "testDataset");
testClient.createPreparationFromDataset(dataSetId, "testPreparation", home.getId());
// when/then
final Response response = when().delete("/api/datasets/" + dataSetId);
// then
final int statusCode = response.statusCode();
assertThat(statusCode, is(409));
final String responseAsString = response.asString();
final JsonPath json = from(responseAsString);
assertThat(json.get("code"), is("TDP_API_DATASET_STILL_IN_USE"));
}
Aggregations