Search in sources :

Example 6 with MainDeploy

use of org.folio.okapi.MainDeploy in project okapi by folio-org.

the class MainDeployTest method testHelp.

@Test
public void testHelp(TestContext context) {
    async = context.async();
    String[] args = { "help" };
    MainDeploy d = new MainDeploy();
    d.init(args, res -> {
        vertx = res.succeeded() ? res.result() : null;
        Assert.assertTrue(res.succeeded());
        async.complete();
    });
}
Also used : MainDeploy(org.folio.okapi.MainDeploy) Test(org.junit.Test)

Example 7 with MainDeploy

use of org.folio.okapi.MainDeploy in project okapi by folio-org.

the class MainDeployTest method testProxyMode.

@Test
public void testProxyMode(TestContext context) {
    async = context.async();
    String[] args = { "proxy" };
    MainDeploy d = new MainDeploy();
    d.init(args, res -> {
        vertx = res.succeeded() ? res.result() : null;
        Assert.assertTrue("main1 " + res.cause(), res.succeeded());
        RestAssuredClient c;
        Response r;
        c = api.createRestAssured3();
        r = c.given().get("/_/proxy/modules").then().statusCode(200).log().ifValidationFails().extract().response();
        Assert.assertTrue("raml: " + c.getLastReport().toString(), c.getLastReport().isEmpty());
        async.complete();
    });
}
Also used : Response(io.restassured.response.Response) MainDeploy(org.folio.okapi.MainDeploy) RestAssuredClient(guru.nidi.ramltester.restassured3.RestAssuredClient) Test(org.junit.Test)

Example 8 with MainDeploy

use of org.folio.okapi.MainDeploy in project okapi by folio-org.

the class MainDeployTest method testNoArgs.

@Test
public void testNoArgs(TestContext context) {
    async = context.async();
    String[] args = {};
    MainDeploy d = new MainDeploy();
    d.init(args, res -> {
        Assert.assertFalse(res.succeeded());
        vertx = res.succeeded() ? res.result() : null;
        async.complete();
    });
}
Also used : MainDeploy(org.folio.okapi.MainDeploy) Test(org.junit.Test)

Example 9 with MainDeploy

use of org.folio.okapi.MainDeploy in project okapi by folio-org.

the class MainDeployTest method testDeploymentMode.

@Test
public void testDeploymentMode(TestContext context) {
    async = context.async();
    String[] args = { "deployment" };
    MainDeploy d = new MainDeploy();
    d.init(args, res -> {
        vertx = res.succeeded() ? res.result() : null;
        Assert.assertTrue("main1" + res.cause(), res.succeeded());
        RestAssuredClient c;
        Response r;
        c = api.createRestAssured3();
        r = c.given().get("/_/deployment/modules").then().statusCode(200).log().ifValidationFails().extract().response();
        Assert.assertTrue("raml: " + c.getLastReport().toString(), c.getLastReport().isEmpty());
        async.complete();
    });
}
Also used : Response(io.restassured.response.Response) MainDeploy(org.folio.okapi.MainDeploy) RestAssuredClient(guru.nidi.ramltester.restassured3.RestAssuredClient) Test(org.junit.Test)

Example 10 with MainDeploy

use of org.folio.okapi.MainDeploy in project okapi by folio-org.

the class MainDeployTest method testClusterModeFail3.

@Test
public void testClusterModeFail3(TestContext context) {
    async = context.async();
    String[] args = { "cluster", "-hazelcast-config-cp", "foobar" };
    MainDeploy d = new MainDeploy();
    d.init(args, res -> {
        vertx = res.succeeded() ? res.result() : null;
        Assert.assertTrue("main1 " + res.cause(), res.failed());
        async.complete();
    });
}
Also used : MainDeploy(org.folio.okapi.MainDeploy) Test(org.junit.Test)

Aggregations

MainDeploy (org.folio.okapi.MainDeploy)13 Test (org.junit.Test)12 RestAssuredClient (guru.nidi.ramltester.restassured3.RestAssuredClient)4 Response (io.restassured.response.Response)4 JsonObject (io.vertx.core.json.JsonObject)1 Async (io.vertx.ext.unit.Async)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Before (org.junit.Before)1