use of ai.grakn.engine.controller.response.Concept in project grakn by graknlabs.
the class ConceptControllerTest method assertConceptsReturned.
private static void assertConceptsReturned(String path, Class<? extends Concept[]> clazz, String key, Concept... concepts) {
String request = REST.resolveTemplate(path, keyspace.getValue());
Response response = RestAssured.when().get(request);
assertEquals(SC_OK, response.statusCode());
Concept[] conceptsFound = response.jsonPath().getObject(key, clazz);
assertThat(Arrays.asList(conceptsFound), hasItems(concepts));
}
use of ai.grakn.engine.controller.response.Concept in project grakn by graknlabs.
the class GraqlControllerTest method whenRunningInsertQuery_JsonResponseCanBeMappedToJavaObject.
@Test
public void whenRunningInsertQuery_JsonResponseCanBeMappedToJavaObject() {
Concept expectedConcept = ConceptBuilder.build(sampleKB.tx().getEntityType("movie"));
Json json = Json.read(sendQuery("insert $x label movie;", APPLICATION_JSON).body().asString()).asJsonList().iterator().next().at("x");
Concept concept = JsonConceptBuilder.build(json);
assertEquals(expectedConcept, concept);
}
Aggregations