use of com.jayway.restassured.path.json.JsonPath in project data-prep by Talend.
the class PreparationAPITest method testPreparationsList_withFilterOnFullPath.
@Test
public void testPreparationsList_withFilterOnFullPath() throws Exception {
// given
String tagadaId = testClient.createDataset("dataset/dataset.csv", "tagada");
String preparationName = "tagadaPreparation";
String preparationId = testClient.createPreparationFromDataset(tagadaId, preparationName, home.getId());
// when : short format
final JsonPath shouldNotBeEmpty = when().get("/api/preparations/?format=short&path={path}", "/" + preparationName).jsonPath();
// then
assertThat(shouldNotBeEmpty.<String>getList("id").get(0), is(preparationId));
// when
final JsonPath shouldBeEmpty = when().get("/api/preparations/?format=short&path={path}", "/toto/" + preparationName).jsonPath();
// then
assertThat(shouldBeEmpty.<String>getList("id"), is(empty()));
}
use of com.jayway.restassured.path.json.JsonPath in project data-prep by Talend.
the class DatasetStep method thenICheckTheDataSetRecordsNumber.
@Then("^I check that the dataSet \"(.*)\" has \"(.*)\" records$")
public void thenICheckTheDataSetRecordsNumber(String datasetName, String recordNumber) throws IOException {
Response response = api.getDataSetMetaData(context.getDatasetId(suffixName(datasetName)));
response.then().statusCode(OK.value());
final JsonPath jsonPath = response.body().jsonPath();
assertEquals(recordNumber, jsonPath.get("records").toString());
}
Aggregations