Search in sources :

Example 6 with IntegrationTestSupport

use of org.eclipse.hono.tests.IntegrationTestSupport in project hono by eclipse.

the class HttpTestBase method init.

/**
 * Sets up clients.
 *
 * @param ctx The vert.x test context.
 */
@BeforeClass
public static void init(final TestContext ctx) {
    helper = new IntegrationTestSupport(VERTX);
    helper.init(ctx);
    httpClient = new CrudHttpClient(VERTX, IntegrationTestSupport.HTTP_HOST, IntegrationTestSupport.HTTP_PORT);
}
Also used : IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) CrudHttpClient(org.eclipse.hono.tests.CrudHttpClient) BeforeClass(org.junit.BeforeClass)

Example 7 with IntegrationTestSupport

use of org.eclipse.hono.tests.IntegrationTestSupport in project hono by eclipse.

the class DeviceRegistryTestBase method setUp.

/**
 * Creates a new integration test helper and connects to the messaging network.
 *
 * @param vertx The vert.x instance to use for the helper.
 */
@BeforeEach
public void setUp(final Vertx vertx, final VertxTestContext ctx) {
    helper = new IntegrationTestSupport(vertx);
    helper.initRegistryClient();
    helper.init().onComplete(ctx.succeedingThenComplete());
}
Also used : IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 8 with IntegrationTestSupport

use of org.eclipse.hono.tests.IntegrationTestSupport in project hono by eclipse.

the class HttpTestBase method setUp.

/**
 * Sets up the fixture.
 *
 * @param testInfo Meta info about the test being run.
 * @param ctx The vert.x test context.
 */
@BeforeEach
public void setUp(final TestInfo testInfo, final VertxTestContext ctx) {
    testStartTimeMillis = System.currentTimeMillis();
    logger.info("running {}", testInfo.getDisplayName());
    helper = new IntegrationTestSupport(vertx);
    logger.info("using HTTP adapter [host: {}, http port: {}, https port: {}]", IntegrationTestSupport.HTTP_HOST, IntegrationTestSupport.HTTP_PORT, IntegrationTestSupport.HTTPS_PORT);
    deviceCert = SelfSignedCertificate.create(UUID.randomUUID().toString());
    httpClient = new CrudHttpClient(vertx, new HttpClientOptions(defaultOptions));
    httpClientWithClientCert = new CrudHttpClient(vertx, new HttpClientOptions(defaultOptions).setKeyCertOptions(deviceCert.keyCertOptions()));
    tenantId = helper.getRandomTenantId();
    deviceId = helper.getRandomDeviceId(tenantId);
    authorization = getBasicAuth(tenantId, deviceId, PWD);
    helper.init().onComplete(ctx.succeedingThenComplete());
}
Also used : IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) CrudHttpClient(org.eclipse.hono.tests.CrudHttpClient) HttpClientOptions(io.vertx.core.http.HttpClientOptions) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 9 with IntegrationTestSupport

use of org.eclipse.hono.tests.IntegrationTestSupport in project hono by eclipse.

the class MqttTestBase method createHelper.

/**
 * Create integration test helper.
 *
 * @param testInfo The JUnit test info.
 * @param ctx The vert.x context.
 */
@BeforeEach
public void createHelper(final TestInfo testInfo, final VertxTestContext ctx) {
    LOGGER.info("running {}", testInfo.getDisplayName());
    helper = new IntegrationTestSupport(vertx);
    helper.init().onComplete(ctx.succeedingThenComplete());
}
Also used : IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

IntegrationTestSupport (org.eclipse.hono.tests.IntegrationTestSupport)9 BeforeEach (org.junit.jupiter.api.BeforeEach)7 CrudHttpClient (org.eclipse.hono.tests.CrudHttpClient)2 BeforeClass (org.junit.BeforeClass)2 HttpClientOptions (io.vertx.core.http.HttpClientOptions)1 InetSocketAddress (java.net.InetSocketAddress)1