Search in sources :

Example 1 with TenantAttributes

use of org.folio.rest.jaxrs.model.TenantAttributes in project raml-module-builder by folio-org.

the class TenantAPIIT method tenantPost.

public void tenantPost(TestContext context) {
    Async async = context.async();
    vertx.runOnContext(run -> {
        TenantAPI tenantAPI = new TenantAPI();
        try {
            TenantAttributes tenantAttributes = new TenantAttributes();
            Map<String, String> map = new HashMap<>();
            map.put("TenantId", tenantId);
            tenantAPI.postTenant(tenantAttributes, map, h -> {
                tenantAPI.tenantExists(Vertx.currentContext(), tenantId, onSuccess(context, bool -> {
                    context.assertTrue(bool, "tenant exists");
                    async.complete();
                }));
            }, Vertx.currentContext());
        } catch (Exception e) {
            context.fail(e);
        }
    });
    async.awaitSuccess();
}
Also used : TestContext(io.vertx.ext.unit.TestContext) Async(io.vertx.ext.unit.Async) AfterClass(org.junit.AfterClass) BeforeClass(org.junit.BeforeClass) RunWith(org.junit.runner.RunWith) Vertx(io.vertx.core.Vertx) HashMap(java.util.HashMap) Test(org.junit.Test) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) VertxUtils(org.folio.rest.tools.utils.VertxUtils) LoggerFactory(io.vertx.core.logging.LoggerFactory) Rule(org.junit.Rule) Map(java.util.Map) TenantAttributes(org.folio.rest.jaxrs.model.TenantAttributes) Timeout(org.junit.rules.Timeout) AsyncResult(io.vertx.core.AsyncResult) Handler(io.vertx.core.Handler) TenantAttributes(org.folio.rest.jaxrs.model.TenantAttributes) HashMap(java.util.HashMap) Async(io.vertx.ext.unit.Async)

Aggregations

AsyncResult (io.vertx.core.AsyncResult)1 Handler (io.vertx.core.Handler)1 Vertx (io.vertx.core.Vertx)1 LoggerFactory (io.vertx.core.logging.LoggerFactory)1 Async (io.vertx.ext.unit.Async)1 TestContext (io.vertx.ext.unit.TestContext)1 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TenantAttributes (org.folio.rest.jaxrs.model.TenantAttributes)1 VertxUtils (org.folio.rest.tools.utils.VertxUtils)1 AfterClass (org.junit.AfterClass)1 BeforeClass (org.junit.BeforeClass)1 Rule (org.junit.Rule)1 Test (org.junit.Test)1 Timeout (org.junit.rules.Timeout)1 RunWith (org.junit.runner.RunWith)1