Search in sources :

Example 1 with ProtonBasedTenantClient

use of org.eclipse.hono.client.registry.amqp.ProtonBasedTenantClient in project hono by eclipse.

the class TenantAmqpIT method createTenantClients.

/**
 * Creates clients for invoking operations of the
 * Tenant API.
 *
 * @param vertx The vert.x instance to run the clients on.
 * @param ctx The vert.x test context.
 */
@BeforeAll
public static void createTenantClients(final Vertx vertx, final VertxTestContext ctx) {
    final Checkpoint connections = ctx.checkpoint(2);
    allTenantClient = new ProtonBasedTenantClient(HonoConnection.newConnection(vertx, IntegrationTestSupport.getDeviceRegistryProperties(IntegrationTestSupport.TENANT_ADMIN_USER, IntegrationTestSupport.TENANT_ADMIN_PWD)), SendMessageSampler.Factory.noop(), null);
    allTenantClient.start().onComplete(ctx.succeeding(r -> {
        connections.flag();
    }));
    defaultTenantClient = new ProtonBasedTenantClient(HonoConnection.newConnection(vertx, IntegrationTestSupport.getDeviceRegistryProperties(IntegrationTestSupport.HONO_USER, IntegrationTestSupport.HONO_PWD)), SendMessageSampler.Factory.noop(), null);
    defaultTenantClient.start().onComplete(ctx.succeeding(r -> {
        connections.flag();
    }));
}
Also used : AfterAll(org.junit.jupiter.api.AfterAll) VertxTestContext(io.vertx.junit5.VertxTestContext) IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) BeforeAll(org.junit.jupiter.api.BeforeAll) ProtonBasedTenantClient(org.eclipse.hono.client.registry.amqp.ProtonBasedTenantClient) Vertx(io.vertx.core.Vertx) SendMessageSampler(org.eclipse.hono.client.SendMessageSampler) Checkpoint(io.vertx.junit5.Checkpoint) TenantClient(org.eclipse.hono.client.registry.TenantClient) HonoConnection(org.eclipse.hono.client.HonoConnection) VertxExtension(io.vertx.junit5.VertxExtension) Checkpoint(io.vertx.junit5.Checkpoint) ProtonBasedTenantClient(org.eclipse.hono.client.registry.amqp.ProtonBasedTenantClient) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

Vertx (io.vertx.core.Vertx)1 Checkpoint (io.vertx.junit5.Checkpoint)1 VertxExtension (io.vertx.junit5.VertxExtension)1 VertxTestContext (io.vertx.junit5.VertxTestContext)1 HonoConnection (org.eclipse.hono.client.HonoConnection)1 SendMessageSampler (org.eclipse.hono.client.SendMessageSampler)1 TenantClient (org.eclipse.hono.client.registry.TenantClient)1 ProtonBasedTenantClient (org.eclipse.hono.client.registry.amqp.ProtonBasedTenantClient)1 IntegrationTestSupport (org.eclipse.hono.tests.IntegrationTestSupport)1 AfterAll (org.junit.jupiter.api.AfterAll)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)1