Search in sources :

Example 11 with MainDeploy

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

the class MainDeployTest method testClusterModeFail4.

@Test
public void testClusterModeFail4(TestContext context) {
    async = context.async();
    String[] args = { "cluster", "-hazelcast-config-url", "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)

Example 12 with MainDeploy

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

the class MainDeployTest method testClusterModeFail1.

@Test
public void testClusterModeFail1(TestContext context) {
    async = context.async();
    String[] args = { "cluster", "-cluster-host", "foobar", "-cluster-port", "5701" };
    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)

Example 13 with MainDeploy

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

the class MultiTenantTest method setUp.

@Before
public void setUp(TestContext context) {
    Async async = context.async();
    RestAssured.port = port;
    JsonObject conf = new JsonObject();
    conf.put("port", Integer.toString(port));
    MainDeploy d = new MainDeploy(conf);
    String[] args = { "cluster" };
    d.init(args, res -> {
        if (res.succeeded()) {
            vertx = res.result();
        }
        context.assertTrue(res.succeeded());
        async.complete();
    });
}
Also used : Async(io.vertx.ext.unit.Async) JsonObject(io.vertx.core.json.JsonObject) MainDeploy(org.folio.okapi.MainDeploy) Matchers.containsString(org.hamcrest.Matchers.containsString) Before(org.junit.Before)

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