Search in sources :

Example 56 with Adapter

use of org.eclipse.hono.util.Adapter in project hono by eclipse.

the class AbstractVertxBasedHttpProtocolAdapterTest method testUploadCommandResponseFailsForOtherDevice.

/**
 * Verifies that an authenticated device that is not a gateway fails to
 * upload a command response for another device.
 */
@Test
public void testUploadCommandResponseFailsForOtherDevice() {
    givenAnAdapter(properties);
    final Buffer payload = Buffer.buffer("some payload");
    final HttpContext ctx = newHttpContext(payload, "application/text", mock(HttpServerRequest.class), mock(HttpServerResponse.class));
    final TenantObject to = TenantObject.from("tenant", true);
    // Given an adapter that is enabled for a device's tenant
    to.addAdapter(new Adapter(ADAPTER_TYPE).setEnabled(Boolean.TRUE));
    when(tenantClient.get(eq("tenant"), (SpanContext) any())).thenReturn(Future.succeededFuture(to));
    // which is connected to a Credentials service that has credentials on record for device 9999
    when(ctx.getAuthenticatedDevice()).thenReturn(new DeviceUser("tenant", "9999"));
    // but for which no registration information is available
    when(registrationClient.assertRegistration(anyString(), anyString(), any(), any())).thenReturn(Future.failedFuture(new ClientErrorException(HttpURLConnection.HTTP_NOT_FOUND, "cannot publish data for device of other tenant")));
    adapter.uploadCommandResponseMessage(ctx, "tenant", "device", CMD_REQ_ID, 200);
    // Then the device gets a 404
    assertContextFailedWithClientError(ctx, HttpURLConnection.HTTP_NOT_FOUND);
    // and the response has not been reported as forwarded
    verify(metrics).reportCommand(eq(Direction.RESPONSE), eq("tenant"), eq(to), eq(ProcessingOutcome.UNPROCESSABLE), eq(payload.length()), any());
}
Also used : Buffer(io.vertx.core.buffer.Buffer) TenantObject(org.eclipse.hono.util.TenantObject) DeviceUser(org.eclipse.hono.service.auth.DeviceUser) HttpServerRequest(io.vertx.core.http.HttpServerRequest) HttpServerResponse(io.vertx.core.http.HttpServerResponse) HttpContext(org.eclipse.hono.service.http.HttpContext) ClientErrorException(org.eclipse.hono.client.ClientErrorException) Adapter(org.eclipse.hono.util.Adapter) Test(org.junit.jupiter.api.Test)

Example 57 with Adapter

use of org.eclipse.hono.util.Adapter in project hono by eclipse.

the class AbstractVertxBasedHttpProtocolAdapterTest method testUploadCommandResponseFailsForDisabledTenant.

/**
 * Verifies that the adapter fails the upload of a command response with a 403
 * if the adapter is disabled for the device's tenant.
 */
@Test
public void testUploadCommandResponseFailsForDisabledTenant() {
    // GIVEN an adapter that is not enabled for a device's tenant
    final TenantObject to = TenantObject.from("tenant", true);
    to.addAdapter(new Adapter(Constants.PROTOCOL_ADAPTER_TYPE_HTTP).setEnabled(Boolean.FALSE));
    when(tenantClient.get(eq("tenant"), (SpanContext) any())).thenReturn(Future.succeededFuture(to));
    givenAnAdapter(properties);
    // WHEN a device publishes a command response
    final Buffer payload = Buffer.buffer("some payload");
    final HttpContext ctx = newHttpContext(payload, "application/text", mock(HttpServerRequest.class), mock(HttpServerResponse.class));
    adapter.uploadCommandResponseMessage(ctx, "tenant", "device", CMD_REQ_ID, 200);
    // THEN the device gets a 403
    assertContextFailedWithClientError(ctx, HttpURLConnection.HTTP_FORBIDDEN);
    // and the response has been reported as undeliverable
    verify(metrics).reportCommand(eq(Direction.RESPONSE), eq("tenant"), eq(to), eq(ProcessingOutcome.UNPROCESSABLE), eq(payload.length()), any());
}
Also used : Buffer(io.vertx.core.buffer.Buffer) TenantObject(org.eclipse.hono.util.TenantObject) HttpServerRequest(io.vertx.core.http.HttpServerRequest) HttpServerResponse(io.vertx.core.http.HttpServerResponse) HttpContext(org.eclipse.hono.service.http.HttpContext) Adapter(org.eclipse.hono.util.Adapter) Test(org.junit.jupiter.api.Test)

Example 58 with Adapter

use of org.eclipse.hono.util.Adapter in project hono by eclipse.

the class CoapTestBase method testUploadMessagesUsingClientCertificate.

/**
 * Verifies that a number of messages uploaded to Hono's CoAP adapter using TLS_ECDSA based authentication can be
 * successfully consumed via the messaging infrastructure.
 *
 * @param ctx The test context.
 * @throws InterruptedException if the test fails.
 */
@Test
public void testUploadMessagesUsingClientCertificate(final VertxTestContext ctx) throws InterruptedException {
    final var clientCertLoader = KeyLoader.fromFiles(vertx, PATH_DEVICE_KEY, PATH_DEVICE_CERT);
    final var clientCert = (X509Certificate) clientCertLoader.getCertificateChain()[0];
    final VertxTestContext setup = new VertxTestContext();
    helper.getCertificate(PATH_CA_CERT).compose(caCert -> {
        final var tenant = Tenants.createTenantForTrustAnchor(caCert);
        return helper.registry.addDeviceForTenant(tenantId, tenant, deviceId, clientCert);
    }).onComplete(setup.succeedingThenComplete());
    assertThat(setup.awaitCompletion(5, TimeUnit.SECONDS)).isTrue();
    if (setup.failed()) {
        ctx.failNow(setup.causeOfFailure());
        return;
    }
    final CoapClient client = getCoapsClient(clientCertLoader);
    testUploadMessages(ctx, tenantId, () -> warmUp(client, createCoapsRequest(Code.POST, getPostResource(), 0)), count -> {
        final Promise<OptionSet> result = Promise.promise();
        final Request request = createCoapsRequest(Code.POST, getPostResource(), count);
        client.advanced(getHandler(result), request);
        return result.future();
    });
}
Also used : HttpURLConnection(java.net.HttpURLConnection) X509Certificate(java.security.cert.X509Certificate) ResponseCode(org.eclipse.californium.core.coap.CoAP.ResponseCode) KeyPair(java.security.KeyPair) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) DownstreamMessage(org.eclipse.hono.application.client.DownstreamMessage) AdvancedPskStore(org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) CertificateType(org.eclipse.californium.scandium.dtls.CertificateType) Tenant(org.eclipse.hono.service.management.tenant.Tenant) Timeout(io.vertx.junit5.Timeout) CoapResponse(org.eclipse.californium.core.CoapResponse) NetworkConfig(org.eclipse.californium.core.network.config.NetworkConfig) GeneralSecurityException(java.security.GeneralSecurityException) DTLSConnector(org.eclipse.californium.scandium.DTLSConnector) IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Utils(org.eclipse.californium.core.Utils) JsonObject(io.vertx.core.json.JsonObject) URI(java.net.URI) Tenants(org.eclipse.hono.tests.Tenants) MethodSource(org.junit.jupiter.params.provider.MethodSource) Device(org.eclipse.hono.service.management.device.Device) DtlsConnectorConfig(org.eclipse.californium.scandium.config.DtlsConnectorConfig) MessageContext(org.eclipse.hono.application.client.MessageContext) SubscriberRole(org.eclipse.hono.tests.CommandEndpointConfiguration.SubscriberRole) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) DownstreamMessageAssertions(org.eclipse.hono.tests.DownstreamMessageAssertions) InetSocketAddress(java.net.InetSocketAddress) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) TestInfo(org.junit.jupiter.api.TestInfo) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Stream(java.util.stream.Stream) Request(org.eclipse.californium.core.coap.Request) Buffer(io.vertx.core.buffer.Buffer) Optional(java.util.Optional) QoS(org.eclipse.hono.util.QoS) VertxTestContext(io.vertx.junit5.VertxTestContext) CoapClient(org.eclipse.californium.core.CoapClient) X500Principal(javax.security.auth.x500.X500Principal) KeyLoader(org.eclipse.hono.config.KeyLoader) ServiceInvocationException(org.eclipse.hono.client.ServiceInvocationException) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Constants(org.eclipse.hono.util.Constants) CoapEndpoint(org.eclipse.californium.core.network.CoapEndpoint) MediaTypeRegistry(org.eclipse.californium.core.coap.MediaTypeRegistry) StaticNewAdvancedCertificateVerifier(org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier) AsyncResult(io.vertx.core.AsyncResult) CommandConstants(org.eclipse.hono.util.CommandConstants) RegistryManagementConstants(org.eclipse.hono.util.RegistryManagementConstants) Type(org.eclipse.californium.core.coap.CoAP.Type) Logger(org.slf4j.Logger) AdvancedSinglePskStore(org.eclipse.californium.scandium.dtls.pskstore.AdvancedSinglePskStore) Promise(io.vertx.core.Promise) Vertx(io.vertx.core.Vertx) Truth.assertThat(com.google.common.truth.Truth.assertThat) Inet4Address(java.net.Inet4Address) UnknownHostException(java.net.UnknownHostException) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Code(org.eclipse.californium.core.coap.CoAP.Code) Adapter(org.eclipse.hono.util.Adapter) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) CoapHandler(org.eclipse.californium.core.CoapHandler) MessageConsumer(org.eclipse.hono.application.client.MessageConsumer) OptionSet(org.eclipse.californium.core.coap.OptionSet) Handler(io.vertx.core.Handler) Collections(java.util.Collections) VertxTestContext(io.vertx.junit5.VertxTestContext) Request(org.eclipse.californium.core.coap.Request) OptionSet(org.eclipse.californium.core.coap.OptionSet) X509Certificate(java.security.cert.X509Certificate) CoapClient(org.eclipse.californium.core.CoapClient) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 59 with Adapter

use of org.eclipse.hono.util.Adapter in project hono by eclipse.

the class CoapTestBase method testUploadMessageFailsForUnauthorizedGateway.

/**
 * Verifies that the CoAP adapter rejects messages from a gateway for a device that it is not authorized for with a
 * 403.
 *
 * @param ctx The test context
 */
@Test
@Timeout(value = 10, timeUnit = TimeUnit.SECONDS)
public void testUploadMessageFailsForUnauthorizedGateway(final VertxTestContext ctx) {
    // GIVEN a device that is connected via gateway "not-the-created-gateway"
    final Tenant tenant = new Tenant();
    final String gatewayId = helper.getRandomDeviceId(tenantId);
    final Device deviceData = new Device();
    deviceData.setVia(Collections.singletonList("not-the-created-gateway"));
    helper.registry.addPskDeviceForTenant(tenantId, tenant, gatewayId, SECRET).compose(ok -> helper.registry.registerDevice(tenantId, deviceId, deviceData)).compose(ok -> {
        // WHEN another gateway tries to upload a message for the device
        final Promise<OptionSet> result = Promise.promise();
        final CoapClient client = getCoapsClient(gatewayId, tenantId, SECRET);
        // THEN a FORBIDDEN response code is returned
        client.advanced(getHandler(result, ResponseCode.FORBIDDEN), createCoapsRequest(Code.PUT, getPutResource(tenantId, deviceId), 0));
        return result.future();
    }).onComplete(ctx.succeedingThenComplete());
}
Also used : HttpURLConnection(java.net.HttpURLConnection) X509Certificate(java.security.cert.X509Certificate) ResponseCode(org.eclipse.californium.core.coap.CoAP.ResponseCode) KeyPair(java.security.KeyPair) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) DownstreamMessage(org.eclipse.hono.application.client.DownstreamMessage) AdvancedPskStore(org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) CertificateType(org.eclipse.californium.scandium.dtls.CertificateType) Tenant(org.eclipse.hono.service.management.tenant.Tenant) Timeout(io.vertx.junit5.Timeout) CoapResponse(org.eclipse.californium.core.CoapResponse) NetworkConfig(org.eclipse.californium.core.network.config.NetworkConfig) GeneralSecurityException(java.security.GeneralSecurityException) DTLSConnector(org.eclipse.californium.scandium.DTLSConnector) IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Utils(org.eclipse.californium.core.Utils) JsonObject(io.vertx.core.json.JsonObject) URI(java.net.URI) Tenants(org.eclipse.hono.tests.Tenants) MethodSource(org.junit.jupiter.params.provider.MethodSource) Device(org.eclipse.hono.service.management.device.Device) DtlsConnectorConfig(org.eclipse.californium.scandium.config.DtlsConnectorConfig) MessageContext(org.eclipse.hono.application.client.MessageContext) SubscriberRole(org.eclipse.hono.tests.CommandEndpointConfiguration.SubscriberRole) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) DownstreamMessageAssertions(org.eclipse.hono.tests.DownstreamMessageAssertions) InetSocketAddress(java.net.InetSocketAddress) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) TestInfo(org.junit.jupiter.api.TestInfo) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Stream(java.util.stream.Stream) Request(org.eclipse.californium.core.coap.Request) Buffer(io.vertx.core.buffer.Buffer) Optional(java.util.Optional) QoS(org.eclipse.hono.util.QoS) VertxTestContext(io.vertx.junit5.VertxTestContext) CoapClient(org.eclipse.californium.core.CoapClient) X500Principal(javax.security.auth.x500.X500Principal) KeyLoader(org.eclipse.hono.config.KeyLoader) ServiceInvocationException(org.eclipse.hono.client.ServiceInvocationException) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Constants(org.eclipse.hono.util.Constants) CoapEndpoint(org.eclipse.californium.core.network.CoapEndpoint) MediaTypeRegistry(org.eclipse.californium.core.coap.MediaTypeRegistry) StaticNewAdvancedCertificateVerifier(org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier) AsyncResult(io.vertx.core.AsyncResult) CommandConstants(org.eclipse.hono.util.CommandConstants) RegistryManagementConstants(org.eclipse.hono.util.RegistryManagementConstants) Type(org.eclipse.californium.core.coap.CoAP.Type) Logger(org.slf4j.Logger) AdvancedSinglePskStore(org.eclipse.californium.scandium.dtls.pskstore.AdvancedSinglePskStore) Promise(io.vertx.core.Promise) Vertx(io.vertx.core.Vertx) Truth.assertThat(com.google.common.truth.Truth.assertThat) Inet4Address(java.net.Inet4Address) UnknownHostException(java.net.UnknownHostException) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Code(org.eclipse.californium.core.coap.CoAP.Code) Adapter(org.eclipse.hono.util.Adapter) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) CoapHandler(org.eclipse.californium.core.CoapHandler) MessageConsumer(org.eclipse.hono.application.client.MessageConsumer) OptionSet(org.eclipse.californium.core.coap.OptionSet) Handler(io.vertx.core.Handler) Collections(java.util.Collections) Promise(io.vertx.core.Promise) Tenant(org.eclipse.hono.service.management.tenant.Tenant) Device(org.eclipse.hono.service.management.device.Device) CoapClient(org.eclipse.californium.core.CoapClient) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Timeout(io.vertx.junit5.Timeout)

Example 60 with Adapter

use of org.eclipse.hono.util.Adapter in project hono by eclipse.

the class CoapTestBase method testUploadMessages.

/**
 * Uploads messages to the CoAP endpoint.
 *
 * @param ctx The test context to run on.
 * @param tenantId The tenant that the device belongs to.
 * @param warmUp A sender of messages used to warm up the adapter before running the test itself or {@code null} if
 *            no warm up should be performed.
 * @param messageConsumer Consumer that is invoked when a message was received.
 * @param requestSender The test device that will publish the data.
 * @param numberOfMessages The number of messages that are uploaded.
 * @param expectedQos The expected QoS level, may be {@code null} leading to expecting the default for event or telemetry.
 * @throws InterruptedException if the test is interrupted before it has finished.
 */
protected void testUploadMessages(final VertxTestContext ctx, final String tenantId, final Supplier<Future<Void>> warmUp, final Consumer<DownstreamMessage<? extends MessageContext>> messageConsumer, final Function<Integer, Future<OptionSet>> requestSender, final int numberOfMessages, final QoS expectedQos) throws InterruptedException {
    final CountDownLatch received = new CountDownLatch(numberOfMessages);
    final VertxTestContext setup = new VertxTestContext();
    createConsumer(tenantId, msg -> {
        ctx.verify(() -> {
            logger.trace("received {}", msg);
            DownstreamMessageAssertions.assertTelemetryMessageProperties(msg, tenantId);
            assertThat(msg.getQos()).isEqualTo(getExpectedQoS(expectedQos));
            assertAdditionalMessageProperties(msg);
            if (messageConsumer != null) {
                messageConsumer.accept(msg);
            }
        });
        received.countDown();
        if (received.getCount() % 20 == 0) {
            logger.info("messages received: {}", numberOfMessages - received.getCount());
        }
    }).compose(ok -> Optional.ofNullable(warmUp).map(w -> w.get()).orElseGet(() -> Future.succeededFuture())).onComplete(setup.succeedingThenComplete());
    ctx.verify(() -> assertThat(setup.awaitCompletion(5, TimeUnit.SECONDS)).isTrue());
    final long start = System.currentTimeMillis();
    final AtomicInteger messageCount = new AtomicInteger(0);
    while (messageCount.get() < numberOfMessages && !ctx.failed()) {
        final CountDownLatch sending = new CountDownLatch(1);
        requestSender.apply(messageCount.getAndIncrement()).compose(this::assertCoapResponse).onComplete(attempt -> {
            if (attempt.succeeded()) {
                logger.debug("sent message {}", messageCount.get());
            } else {
                logger.info("failed to send message {}: {}", messageCount.get(), attempt.cause().getMessage());
                ctx.failNow(attempt.cause());
            }
            sending.countDown();
        });
        if (messageCount.get() % 20 == 0) {
            logger.info("messages sent: {}", messageCount.get());
        }
        sending.await();
    }
    if (ctx.failed()) {
        return;
    }
    final long timeToWait = Math.max(TEST_TIMEOUT_MILLIS - 1000, Math.round(numberOfMessages * 20));
    if (received.await(timeToWait, TimeUnit.MILLISECONDS)) {
        logger.info("sent {} and received {} messages after {} milliseconds", messageCount, numberOfMessages - received.getCount(), System.currentTimeMillis() - start);
        ctx.completeNow();
    } else {
        logger.info("sent {} and received {} messages after {} milliseconds", messageCount, numberOfMessages - received.getCount(), System.currentTimeMillis() - start);
        ctx.failNow(new AssertionError("did not receive all messages sent"));
    }
}
Also used : HttpURLConnection(java.net.HttpURLConnection) X509Certificate(java.security.cert.X509Certificate) ResponseCode(org.eclipse.californium.core.coap.CoAP.ResponseCode) KeyPair(java.security.KeyPair) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) DownstreamMessage(org.eclipse.hono.application.client.DownstreamMessage) AdvancedPskStore(org.eclipse.californium.scandium.dtls.pskstore.AdvancedPskStore) URISyntaxException(java.net.URISyntaxException) LoggerFactory(org.slf4j.LoggerFactory) CertificateType(org.eclipse.californium.scandium.dtls.CertificateType) Tenant(org.eclipse.hono.service.management.tenant.Tenant) Timeout(io.vertx.junit5.Timeout) CoapResponse(org.eclipse.californium.core.CoapResponse) NetworkConfig(org.eclipse.californium.core.network.config.NetworkConfig) GeneralSecurityException(java.security.GeneralSecurityException) DTLSConnector(org.eclipse.californium.scandium.DTLSConnector) IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Utils(org.eclipse.californium.core.Utils) JsonObject(io.vertx.core.json.JsonObject) URI(java.net.URI) Tenants(org.eclipse.hono.tests.Tenants) MethodSource(org.junit.jupiter.params.provider.MethodSource) Device(org.eclipse.hono.service.management.device.Device) DtlsConnectorConfig(org.eclipse.californium.scandium.config.DtlsConnectorConfig) MessageContext(org.eclipse.hono.application.client.MessageContext) SubscriberRole(org.eclipse.hono.tests.CommandEndpointConfiguration.SubscriberRole) Truth.assertWithMessage(com.google.common.truth.Truth.assertWithMessage) DownstreamMessageAssertions(org.eclipse.hono.tests.DownstreamMessageAssertions) InetSocketAddress(java.net.InetSocketAddress) Future(io.vertx.core.Future) StandardCharsets(java.nio.charset.StandardCharsets) TestInfo(org.junit.jupiter.api.TestInfo) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Stream(java.util.stream.Stream) Request(org.eclipse.californium.core.coap.Request) Buffer(io.vertx.core.buffer.Buffer) Optional(java.util.Optional) QoS(org.eclipse.hono.util.QoS) VertxTestContext(io.vertx.junit5.VertxTestContext) CoapClient(org.eclipse.californium.core.CoapClient) X500Principal(javax.security.auth.x500.X500Principal) KeyLoader(org.eclipse.hono.config.KeyLoader) ServiceInvocationException(org.eclipse.hono.client.ServiceInvocationException) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Constants(org.eclipse.hono.util.Constants) CoapEndpoint(org.eclipse.californium.core.network.CoapEndpoint) MediaTypeRegistry(org.eclipse.californium.core.coap.MediaTypeRegistry) StaticNewAdvancedCertificateVerifier(org.eclipse.californium.scandium.dtls.x509.StaticNewAdvancedCertificateVerifier) AsyncResult(io.vertx.core.AsyncResult) CommandConstants(org.eclipse.hono.util.CommandConstants) RegistryManagementConstants(org.eclipse.hono.util.RegistryManagementConstants) Type(org.eclipse.californium.core.coap.CoAP.Type) Logger(org.slf4j.Logger) AdvancedSinglePskStore(org.eclipse.californium.scandium.dtls.pskstore.AdvancedSinglePskStore) Promise(io.vertx.core.Promise) Vertx(io.vertx.core.Vertx) Truth.assertThat(com.google.common.truth.Truth.assertThat) Inet4Address(java.net.Inet4Address) UnknownHostException(java.net.UnknownHostException) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Code(org.eclipse.californium.core.coap.CoAP.Code) Adapter(org.eclipse.hono.util.Adapter) AfterEach(org.junit.jupiter.api.AfterEach) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) CoapHandler(org.eclipse.californium.core.CoapHandler) MessageConsumer(org.eclipse.hono.application.client.MessageConsumer) OptionSet(org.eclipse.californium.core.coap.OptionSet) Handler(io.vertx.core.Handler) Collections(java.util.Collections) VertxTestContext(io.vertx.junit5.VertxTestContext) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

Adapter (org.eclipse.hono.util.Adapter)77 Test (org.junit.jupiter.api.Test)74 Truth.assertThat (com.google.common.truth.Truth.assertThat)64 VertxTestContext (io.vertx.junit5.VertxTestContext)64 HttpURLConnection (java.net.HttpURLConnection)64 Timeout (io.vertx.junit5.Timeout)63 TimeUnit (java.util.concurrent.TimeUnit)63 Constants (org.eclipse.hono.util.Constants)62 Future (io.vertx.core.Future)61 Promise (io.vertx.core.Promise)61 JsonObject (io.vertx.core.json.JsonObject)47 Tenant (org.eclipse.hono.service.management.tenant.Tenant)47 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)47 IntegrationTestSupport (org.eclipse.hono.tests.IntegrationTestSupport)45 Tenants (org.eclipse.hono.tests.Tenants)45 BeforeEach (org.junit.jupiter.api.BeforeEach)45 RegistryManagementConstants (org.eclipse.hono.util.RegistryManagementConstants)44 VertxExtension (io.vertx.junit5.VertxExtension)42 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)42 Buffer (io.vertx.core.buffer.Buffer)40