Search in sources :

Example 21 with ValidatableResponse

use of io.restassured.response.ValidatableResponse in project bisq-api by mrosseel.

the class ApiTestHelper method registerArbitrator.

public static ValidatableResponse registerArbitrator(int apiPort) throws InterruptedException {
    final ValidatableResponse validatableResponse = given().port(apiPort).when().body("{\"languageCodes\":[\"en\",\"de\"]}").contentType(ContentType.JSON).post("/api/v1/arbitrators").then().statusCode(204);
    /* Wait for arbiter registration message to be broadcast across peers*/
    waitForP2PMsgPropagation();
    return validatableResponse;
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse)

Example 22 with ValidatableResponse

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

the class RestControllerV2APIIT method testRetrieveEntityCollectionPost.

@Test
public void testRetrieveEntityCollectionPost() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).post(API_V2 + "V2_API_TypeTestRefAPIV2?_method=GET").then().log().all();
    validateRetrieveEntityCollection(response);
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) Test(org.testng.annotations.Test)

Example 23 with ValidatableResponse

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

the class RestControllerV2APIIT method testRetrieveEntityAttributeMetaPost.

@Test
public void testRetrieveEntityAttributeMetaPost() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).post(API_V2 + "V2_API_TypeTestRefAPIV2/meta/value?_method=GET").then().log().all();
    validateRetrieveEntityAttributeMeta(response);
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) Test(org.testng.annotations.Test)

Example 24 with ValidatableResponse

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

the class RestControllerV2APIIT method testRetrieveEntityWithoutSettingCategoriesResultsInNoCategoricalOptions.

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

Example 25 with ValidatableResponse

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

the class RestControllerV2APIIT method testRetrieveEntityCollection.

@Test
public void testRetrieveEntityCollection() {
    ValidatableResponse response = given().log().all().header(X_MOLGENIS_TOKEN, testUserToken).get(API_V2 + "V2_API_TypeTestRefAPIV2").then().log().all();
    validateRetrieveEntityCollection(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