Search in sources :

Example 11 with ValidatableResponse

use of io.restassured.response.ValidatableResponse in project molgenis by molgenis.

the class RestControllerV1APIIT method testRetrieveEntityAttributeMeta.

@Test
public void testRetrieveEntityAttributeMeta() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).contentType(APPLICATION_JSON).when().get(API_V1 + "V1_API_TypeTestRefAPIV1/meta/value").then().log().all();
    validateRetrieveEntityAttributeMeta(response);
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) Test(org.testng.annotations.Test)

Example 12 with ValidatableResponse

use of io.restassured.response.ValidatableResponse in project molgenis by molgenis.

the class RestControllerV1APIIT method testRetrieveEntityCollectionResponse.

@Test
public void testRetrieveEntityCollectionResponse() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).contentType(APPLICATION_JSON).when().get(API_V1 + "V1_API_Items").then().log().all();
    validateRetrieveEntityCollectionResponse(response);
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) Test(org.testng.annotations.Test)

Example 13 with ValidatableResponse

use of io.restassured.response.ValidatableResponse in project molgenis by molgenis.

the class RestControllerV1APIIT method testRetrieveEntityAttribute.

@Test
public void testRetrieveEntityAttribute() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).contentType(APPLICATION_JSON).when().get(API_V1 + "V1_API_TypeTestAPIV1/1/xxref_value").then().log().all();
    validateRetrieveEntityAttribute(response);
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) Test(org.testng.annotations.Test)

Example 14 with ValidatableResponse

use of io.restassured.response.ValidatableResponse in project molgenis by molgenis.

the class RestControllerV2APIIT method testRetrieveEntityIncludingCategories.

@Test
public void testRetrieveEntityIncludingCategories() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).param("includeCategories", newArrayList("true")).param("attrs", newArrayList("xcategorical_value")).get(API_V2 + "V2_API_TypeTestAPIV2/1").then().log().all();
    response.statusCode(OKE);
    response.body("_meta.attributes[0].categoricalOptions.id", Matchers.hasItems("ref1", "ref2", "ref3"));
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) Test(org.testng.annotations.Test)

Example 15 with ValidatableResponse

use of io.restassured.response.ValidatableResponse in project molgenis by molgenis.

the class RestControllerV2APIIT method testRetrieveEntityWithAttributeFilterPost.

@Test
public void testRetrieveEntityWithAttributeFilterPost() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).param("attrs", newArrayList("label")).post(API_V2 + "V2_API_TypeTestRefAPIV2/ref1?_method=GET").then().log().all();
    validateRetrieveEntityWithAttributeFilter(response);
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) Test(org.testng.annotations.Test)

Aggregations

ValidatableResponse (io.restassured.response.ValidatableResponse)33 Test (org.testng.annotations.Test)24 File (java.io.File)4 Path (java.nio.file.Path)3 EntityTypeRequest (org.molgenis.data.rest.EntityTypeRequest)3 Gson (com.google.gson.Gson)2 Response (io.restassured.response.Response)2 URL (java.net.URL)2 Matchers.containsString (org.hamcrest.Matchers.containsString)2 Test (org.junit.Test)2 EntityCollectionRequest (org.molgenis.data.rest.EntityCollectionRequest)2 JsonParseException (com.fasterxml.jackson.core.JsonParseException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 ProcessingException (com.github.fge.jsonschema.core.exceptions.ProcessingException)1 JsonArray (com.google.gson.JsonArray)1 Param (de.ipk_gatersleben.bit.bi.bridge.brapicomp.testing.config.Param)1 RestAssured.baseURI (io.restassured.RestAssured.baseURI)1 RequestSpecification (io.restassured.specification.RequestSpecification)1 IOException (java.io.IOException)1