Search in sources :

Example 1 with JmsBasedTenantClient

use of org.eclipse.hono.tests.jms.JmsBasedTenantClient in project hono by eclipse.

the class TenantJmsIT method prepareDeviceRegistry.

/**
 * Creates an HTTP client for managing the fixture of test cases
 * and creates clients for invoking operations of the
 * Tenant API.
 *
 * @param ctx The vert.x test context.
 */
@BeforeAll
public static void prepareDeviceRegistry(final VertxTestContext ctx) {
    final Checkpoint connections = ctx.checkpoint(2);
    final ClientConfigProperties allTenantConfig = IntegrationTestSupport.getDeviceRegistryProperties(IntegrationTestSupport.TENANT_ADMIN_USER, IntegrationTestSupport.TENANT_ADMIN_PWD);
    allTenantClient = new JmsBasedTenantClient(JmsBasedHonoConnection.newConnection(allTenantConfig), allTenantConfig);
    allTenantClient.start().onComplete(ctx.succeeding(client -> {
        connections.flag();
    }));
    final ClientConfigProperties defaultTenantConfig = IntegrationTestSupport.getDeviceRegistryProperties(IntegrationTestSupport.HONO_USER, IntegrationTestSupport.HONO_PWD);
    defaultTenantClient = new JmsBasedTenantClient(JmsBasedHonoConnection.newConnection(defaultTenantConfig), defaultTenantConfig);
    defaultTenantClient.start().onComplete(ctx.succeeding(client -> {
        connections.flag();
    }));
}
Also used : HttpURLConnection(java.net.HttpURLConnection) VertxTestContext(io.vertx.junit5.VertxTestContext) TenantConstants(org.eclipse.hono.util.TenantConstants) JmsBasedHonoConnection(org.eclipse.hono.tests.jms.JmsBasedHonoConnection) TenantClient(org.eclipse.hono.client.registry.TenantClient) Truth.assertThat(com.google.common.truth.Truth.assertThat) ServiceInvocationException(org.eclipse.hono.client.ServiceInvocationException) VertxExtension(io.vertx.junit5.VertxExtension) Timeout(io.vertx.junit5.Timeout) TimeUnit(java.util.concurrent.TimeUnit) AfterAll(org.junit.jupiter.api.AfterAll) Test(org.junit.jupiter.api.Test) JmsBasedTenantClient(org.eclipse.hono.tests.jms.JmsBasedTenantClient) IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Buffer(io.vertx.core.buffer.Buffer) BeforeAll(org.junit.jupiter.api.BeforeAll) JsonObject(io.vertx.core.json.JsonObject) Checkpoint(io.vertx.junit5.Checkpoint) ClientConfigProperties(org.eclipse.hono.config.ClientConfigProperties) JmsBasedTenantClient(org.eclipse.hono.tests.jms.JmsBasedTenantClient) Checkpoint(io.vertx.junit5.Checkpoint) ClientConfigProperties(org.eclipse.hono.config.ClientConfigProperties) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

Truth.assertThat (com.google.common.truth.Truth.assertThat)1 Buffer (io.vertx.core.buffer.Buffer)1 JsonObject (io.vertx.core.json.JsonObject)1 Checkpoint (io.vertx.junit5.Checkpoint)1 Timeout (io.vertx.junit5.Timeout)1 VertxExtension (io.vertx.junit5.VertxExtension)1 VertxTestContext (io.vertx.junit5.VertxTestContext)1 HttpURLConnection (java.net.HttpURLConnection)1 TimeUnit (java.util.concurrent.TimeUnit)1 ServiceInvocationException (org.eclipse.hono.client.ServiceInvocationException)1 TenantClient (org.eclipse.hono.client.registry.TenantClient)1 ClientConfigProperties (org.eclipse.hono.config.ClientConfigProperties)1 IntegrationTestSupport (org.eclipse.hono.tests.IntegrationTestSupport)1 JmsBasedHonoConnection (org.eclipse.hono.tests.jms.JmsBasedHonoConnection)1 JmsBasedTenantClient (org.eclipse.hono.tests.jms.JmsBasedTenantClient)1 TenantConstants (org.eclipse.hono.util.TenantConstants)1 AfterAll (org.junit.jupiter.api.AfterAll)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 Test (org.junit.jupiter.api.Test)1 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)1