Search in sources :

Example 1 with AttributeType

use of ai.grakn.engine.controller.response.AttributeType in project grakn by graknlabs.

the class ConceptControllerTest method whenGettingKeysOfType_EnsureAttributesAreReturned.

@Test
public void whenGettingKeysOfType_EnsureAttributesAreReturned() throws IOException {
    Response response = RestAssured.when().get(entityTypeWrapper.keys().id());
    assertEquals(SC_OK, response.getStatusCode());
    AttributeType[] keys = response.jsonPath().getObject("keys", AttributeType[].class);
    assertThat(keys, arrayContainingInAnyOrder(attributeTypeKeyWrapper));
}
Also used : Response(com.jayway.restassured.response.Response) AttributeType(ai.grakn.engine.controller.response.AttributeType) Test(org.junit.Test)

Example 2 with AttributeType

use of ai.grakn.engine.controller.response.AttributeType in project grakn by graknlabs.

the class ConceptControllerTest method whenGettingAttributesOfType_EnsureAttributesAreReturned.

@Test
public void whenGettingAttributesOfType_EnsureAttributesAreReturned() throws IOException {
    Response response = RestAssured.when().get(entityTypeWrapper.attributes().id());
    assertEquals(SC_OK, response.getStatusCode());
    AttributeType[] attributes = response.jsonPath().getObject("attributes", AttributeType[].class);
    assertThat(attributes, arrayContainingInAnyOrder(attributeTypeWrapper, attributeTypeKeyWrapper));
}
Also used : Response(com.jayway.restassured.response.Response) AttributeType(ai.grakn.engine.controller.response.AttributeType) Test(org.junit.Test)

Aggregations

AttributeType (ai.grakn.engine.controller.response.AttributeType)2 Response (com.jayway.restassured.response.Response)2 Test (org.junit.Test)2