Search in sources :

Example 31 with Device

use of org.eclipse.hono.auth.Device in project hono by eclipse.

the class VertxBasedAmqpProtocolAdapterTest method testDeviceConnectionIsClosedOnDeviceOrTenantChangeNotification.

private <T extends AbstractNotification> void testDeviceConnectionIsClosedOnDeviceOrTenantChangeNotification(final T notification) {
    // GIVEN an AMQP adapter
    givenAnAdapter(properties);
    final Promise<Void> startPromise = Promise.promise();
    adapter.doStart(startPromise);
    assertThat(startPromise.future().succeeded()).isTrue();
    @SuppressWarnings("unchecked") final ArgumentCaptor<Handler<io.vertx.core.eventbus.Message<T>>> notificationHandlerCaptor = getEventBusConsumerHandlerArgumentCaptor((NotificationType<T>) notification.getType());
    // with an enabled tenant
    givenAConfiguredTenant(TEST_TENANT_ID, true);
    // WHEN a device connects
    final Device authenticatedDevice = new Device(TEST_TENANT_ID, TEST_DEVICE);
    final Record record = new RecordImpl();
    record.set(AmqpAdapterConstants.KEY_CLIENT_DEVICE, Device.class, authenticatedDevice);
    final ProtonConnection deviceConnection = mock(ProtonConnection.class);
    when(deviceConnection.attachments()).thenReturn(record);
    when(deviceConnection.getRemoteContainer()).thenReturn("deviceContainer");
    adapter.onConnectRequest(deviceConnection);
    final ArgumentCaptor<Handler<AsyncResult<ProtonConnection>>> openHandler = VertxMockSupport.argumentCaptorHandler();
    verify(deviceConnection).openHandler(openHandler.capture());
    openHandler.getValue().handle(Future.succeededFuture(deviceConnection));
    // that wants to receive commands
    final CommandConsumer commandConsumer = mock(CommandConsumer.class);
    when(commandConsumer.close(any())).thenReturn(Future.failedFuture(new ClientErrorException(HttpURLConnection.HTTP_PRECON_FAILED)));
    when(commandConsumerFactory.createCommandConsumer(eq(TEST_TENANT_ID), eq(TEST_DEVICE), VertxMockSupport.anyHandler(), any(), any())).thenReturn(Future.succeededFuture(commandConsumer));
    final String sourceAddress = getCommandEndpoint();
    final ProtonSender sender = getSender(sourceAddress);
    adapter.handleRemoteSenderOpenForCommands(deviceConnection, sender);
    // THEN the connection count is incremented
    verify(metrics).incrementConnections(TEST_TENANT_ID);
    // AND WHEN a notification is sent about the tenant/device having been deleted or disabled
    sendViaEventBusMock(notification, notificationHandlerCaptor.getValue());
    // THEN the device connection is closed
    verify(deviceConnection).close();
    // and the connection count is decremented
    verify(metrics).decrementConnections(TEST_TENANT_ID);
    // and the adapter has closed the command consumer
    verify(commandConsumer).close(any());
}
Also used : Device(org.eclipse.hono.auth.Device) Handler(io.vertx.core.Handler) RecordImpl(org.apache.qpid.proton.engine.impl.RecordImpl) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProtonConnection(io.vertx.proton.ProtonConnection) ProtonSender(io.vertx.proton.ProtonSender) CommandConsumer(org.eclipse.hono.client.command.CommandConsumer) ClientErrorException(org.eclipse.hono.client.ClientErrorException) Record(org.apache.qpid.proton.engine.Record)

Example 32 with Device

use of org.eclipse.hono.auth.Device in project hono by eclipse.

the class VertxBasedAmqpProtocolAdapterTest method testConnectionFailsIfTenantLevelConnectionLimitIsExceeded.

/**
 * Verifies that the connection is rejected as the connection limit for
 * the given tenant is exceeded.
 */
@Test
public void testConnectionFailsIfTenantLevelConnectionLimitIsExceeded() {
    // GIVEN an AMQP adapter that requires devices to authenticate
    properties.setAuthenticationRequired(true);
    givenAnAdapter(properties);
    // WHEN the connection limit for the given tenant exceeds
    when(resourceLimitChecks.isConnectionLimitReached(any(TenantObject.class), any(SpanContext.class))).thenReturn(Future.succeededFuture(Boolean.TRUE));
    // WHEN a device connects
    final Device authenticatedDevice = new Device(TEST_TENANT_ID, TEST_DEVICE);
    final Record record = new RecordImpl();
    record.set(AmqpAdapterConstants.KEY_CLIENT_DEVICE, Device.class, authenticatedDevice);
    final ProtonConnection deviceConnection = mock(ProtonConnection.class);
    when(deviceConnection.attachments()).thenReturn(record);
    adapter.onConnectRequest(deviceConnection);
    @SuppressWarnings("unchecked") final ArgumentCaptor<Handler<AsyncResult<ProtonConnection>>> openHandler = ArgumentCaptor.forClass(Handler.class);
    verify(deviceConnection).openHandler(openHandler.capture());
    openHandler.getValue().handle(Future.succeededFuture(deviceConnection));
    // THEN the adapter does not accept the incoming connection request.
    final ArgumentCaptor<ErrorCondition> errorConditionCaptor = ArgumentCaptor.forClass(ErrorCondition.class);
    verify(deviceConnection).setCondition(errorConditionCaptor.capture());
    assertEquals(AmqpError.UNAUTHORIZED_ACCESS, errorConditionCaptor.getValue().getCondition());
    verify(metrics).reportConnectionAttempt(ConnectionAttemptOutcome.TENANT_CONNECTIONS_EXCEEDED, TEST_TENANT_ID, null);
}
Also used : ProtonConnection(io.vertx.proton.ProtonConnection) TenantObject(org.eclipse.hono.util.TenantObject) SpanContext(io.opentracing.SpanContext) Device(org.eclipse.hono.auth.Device) ErrorCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition) Handler(io.vertx.core.Handler) Record(org.apache.qpid.proton.engine.Record) RecordImpl(org.apache.qpid.proton.engine.impl.RecordImpl) Test(org.junit.jupiter.api.Test)

Example 33 with Device

use of org.eclipse.hono.auth.Device in project hono by eclipse.

the class VertxBasedAmqpProtocolAdapterTest method testMessageLimitExceededForADownstreamMessage.

private void testMessageLimitExceededForADownstreamMessage(final VertxTestContext ctx, final Message message, final Consumer<Void> postUploadAssertions) {
    final ProtonDelivery delivery = mock(ProtonDelivery.class);
    // AT LEAST ONCE
    when(delivery.remotelySettled()).thenReturn(false);
    final AmqpContext amqpContext = AmqpContext.fromMessage(delivery, message, span, null);
    // GIVEN an AMQP adapter
    givenAnAdapter(properties);
    givenATelemetrySenderForAnyTenant();
    // which is enabled for a tenant with exceeded message limit
    when(resourceLimitChecks.isMessageLimitReached(any(TenantObject.class), anyLong(), any(SpanContext.class))).thenReturn(Future.succeededFuture(Boolean.TRUE));
    // WHEN a device uploads a message to the adapter with AT_LEAST_ONCE delivery semantics
    adapter.onMessageReceived(amqpContext).onComplete(ctx.failing(t -> {
        ctx.verify(() -> {
            // THEN the message limit is exceeded
            assertThat(((ClientErrorException) t).getErrorCode()).isEqualTo(HttpUtils.HTTP_TOO_MANY_REQUESTS);
            // AND the client receives a corresponding REJECTED disposition
            verify(delivery).disposition(argThat(s -> {
                if (s instanceof Rejected) {
                    return AmqpError.RESOURCE_LIMIT_EXCEEDED.equals(((Rejected) s).getError().getCondition());
                } else {
                    return false;
                }
            }), eq(true));
            // AND
            postUploadAssertions.accept(null);
        });
        ctx.completeNow();
    }));
}
Also used : HttpURLConnection(java.net.HttpURLConnection) ProtonConnection(io.vertx.proton.ProtonConnection) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) LifecycleChange(org.eclipse.hono.notification.deviceregistry.LifecycleChange) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ProcessingOutcome(org.eclipse.hono.service.metric.MetricsTags.ProcessingOutcome) MessagingType(org.eclipse.hono.util.MessagingType) EventBus(io.vertx.core.eventbus.EventBus) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Map(java.util.Map) DeliveryState(org.apache.qpid.proton.amqp.transport.DeliveryState) AmqpError(org.apache.qpid.proton.amqp.transport.AmqpError) CommandContext(org.eclipse.hono.client.command.CommandContext) RegistrationAssertion(org.eclipse.hono.util.RegistrationAssertion) EventConstants(org.eclipse.hono.util.EventConstants) VertxMockSupport(org.eclipse.hono.test.VertxMockSupport) Span(io.opentracing.Span) NotificationEventBusSupport(org.eclipse.hono.notification.NotificationEventBusSupport) Mockito.mock(org.mockito.Mockito.mock) VertxTestContext(io.vertx.junit5.VertxTestContext) Rejected(org.apache.qpid.proton.amqp.messaging.Rejected) Target(org.apache.qpid.proton.amqp.messaging.Target) ArgumentMatchers.anyBoolean(org.mockito.ArgumentMatchers.anyBoolean) Commands(org.eclipse.hono.client.command.Commands) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) AsyncResult(io.vertx.core.AsyncResult) CommandConstants(org.eclipse.hono.util.CommandConstants) Direction(org.eclipse.hono.service.metric.MetricsTags.Direction) Vertx(io.vertx.core.Vertx) Mockito.times(org.mockito.Mockito.times) ProtonHelper(io.vertx.proton.ProtonHelper) Released(org.apache.qpid.proton.amqp.messaging.Released) SpanContext(io.opentracing.SpanContext) Mockito.never(org.mockito.Mockito.never) ConnectionAttemptOutcome(org.eclipse.hono.service.metric.MetricsTags.ConnectionAttemptOutcome) ResourceLimitChecks(org.eclipse.hono.adapter.resourcelimits.ResourceLimitChecks) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProtonReceiver(io.vertx.proton.ProtonReceiver) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) Context(io.vertx.core.Context) ProtonServer(io.vertx.proton.ProtonServer) Timeout(io.vertx.junit5.Timeout) EndpointType(org.eclipse.hono.service.metric.MetricsTags.EndpointType) NotificationType(org.eclipse.hono.notification.NotificationType) TracingMockSupport(org.eclipse.hono.test.TracingMockSupport) ResourceIdentifier(org.eclipse.hono.util.ResourceIdentifier) Binary(org.apache.qpid.proton.amqp.Binary) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) Data(org.apache.qpid.proton.amqp.messaging.Data) MetricsTags(org.eclipse.hono.service.metric.MetricsTags) ProtonQoS(io.vertx.proton.ProtonQoS) Instant(java.time.Instant) MessageHelper(org.eclipse.hono.util.MessageHelper) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) Device(org.eclipse.hono.auth.Device) Test(org.junit.jupiter.api.Test) ErrorCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition) Buffer(io.vertx.core.buffer.Buffer) CommandConsumer(org.eclipse.hono.client.command.CommandConsumer) Mockito.inOrder(org.mockito.Mockito.inOrder) ProtonSender(io.vertx.proton.ProtonSender) Accepted(org.apache.qpid.proton.amqp.messaging.Accepted) QoS(org.eclipse.hono.util.QoS) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) AbstractNotification(org.eclipse.hono.notification.AbstractNotification) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ProtonDelivery(io.vertx.proton.ProtonDelivery) ConnectionLimitManager(org.eclipse.hono.adapter.limiting.ConnectionLimitManager) HashMap(java.util.HashMap) ClientErrorException(org.eclipse.hono.client.ClientErrorException) ConnectionEventProducer(org.eclipse.hono.adapter.monitoring.ConnectionEventProducer) CommandResponseSender(org.eclipse.hono.client.command.CommandResponseSender) Constants(org.eclipse.hono.util.Constants) ProtocolAdapterTestSupport(org.eclipse.hono.adapter.test.ProtocolAdapterTestSupport) TelemetryConstants(org.eclipse.hono.util.TelemetryConstants) ArgumentCaptor(org.mockito.ArgumentCaptor) RecordImpl(org.apache.qpid.proton.engine.impl.RecordImpl) Message(org.apache.qpid.proton.message.Message) HttpUtils(org.eclipse.hono.service.http.HttpUtils) TenantChangeNotification(org.eclipse.hono.notification.deviceregistry.TenantChangeNotification) InOrder(org.mockito.InOrder) Promise(io.vertx.core.Promise) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) ApplicationProperties(org.apache.qpid.proton.amqp.messaging.ApplicationProperties) CommandResponse(org.eclipse.hono.client.command.CommandResponse) TenantObject(org.eclipse.hono.util.TenantObject) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Source(org.apache.qpid.proton.amqp.transport.Source) Adapter(org.eclipse.hono.util.Adapter) Handler(io.vertx.core.Handler) Record(org.apache.qpid.proton.engine.Record) TenantObject(org.eclipse.hono.util.TenantObject) SpanContext(io.opentracing.SpanContext) ProtonDelivery(io.vertx.proton.ProtonDelivery) Rejected(org.apache.qpid.proton.amqp.messaging.Rejected)

Example 34 with Device

use of org.eclipse.hono.auth.Device in project hono by eclipse.

the class VertxBasedAmqpProtocolAdapterTest method testConnectionFailsIfAdapterIsDisabled.

/**
 * Verifies that the connection is rejected as the adapter is disabled.
 */
@Test
public void testConnectionFailsIfAdapterIsDisabled() {
    // GIVEN an AMQP adapter that requires devices to authenticate
    properties.setAuthenticationRequired(true);
    givenAnAdapter(properties);
    // AND given a tenant for which the AMQP Adapter is disabled
    givenAConfiguredTenant(TEST_TENANT_ID, false);
    // WHEN a device connects
    final Device authenticatedDevice = new Device(TEST_TENANT_ID, TEST_DEVICE);
    final Record record = new RecordImpl();
    record.set(AmqpAdapterConstants.KEY_CLIENT_DEVICE, Device.class, authenticatedDevice);
    record.set(AmqpAdapterConstants.KEY_TLS_CIPHER_SUITE, String.class, "BUMLUX_CIPHER");
    final ProtonConnection deviceConnection = mock(ProtonConnection.class);
    when(deviceConnection.attachments()).thenReturn(record);
    adapter.onConnectRequest(deviceConnection);
    @SuppressWarnings("unchecked") final ArgumentCaptor<Handler<AsyncResult<ProtonConnection>>> openHandler = ArgumentCaptor.forClass(Handler.class);
    verify(deviceConnection).openHandler(openHandler.capture());
    openHandler.getValue().handle(Future.succeededFuture(deviceConnection));
    // THEN the adapter does not accept the incoming connection request.
    final ArgumentCaptor<ErrorCondition> errorConditionCaptor = ArgumentCaptor.forClass(ErrorCondition.class);
    verify(deviceConnection).setCondition(errorConditionCaptor.capture());
    assertEquals(AmqpError.UNAUTHORIZED_ACCESS, errorConditionCaptor.getValue().getCondition());
    verify(metrics).reportConnectionAttempt(ConnectionAttemptOutcome.ADAPTER_DISABLED, TEST_TENANT_ID, "BUMLUX_CIPHER");
}
Also used : ProtonConnection(io.vertx.proton.ProtonConnection) Device(org.eclipse.hono.auth.Device) ErrorCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition) Handler(io.vertx.core.Handler) Record(org.apache.qpid.proton.engine.Record) RecordImpl(org.apache.qpid.proton.engine.impl.RecordImpl) Test(org.junit.jupiter.api.Test)

Example 35 with Device

use of org.eclipse.hono.auth.Device in project hono by eclipse.

the class VertxBasedAmqpProtocolAdapterTest method testUploadTelemetryWithAtMostOnceDeliverySemantics.

/**
 * Verifies that a request to upload a pre-settled telemetry message results
 * in the downstream sender not waiting for the consumer's acknowledgment.
 *
 * @param ctx The vert.x test context.
 */
@Test
public void testUploadTelemetryWithAtMostOnceDeliverySemantics(final VertxTestContext ctx) {
    // GIVEN an AMQP adapter with a configured server
    givenAnAdapter(properties);
    // sending of downstream telemetry message succeeds
    givenATelemetrySenderForAnyTenant();
    // which is enabled for a tenant
    final TenantObject tenantObject = givenAConfiguredTenant(TEST_TENANT_ID, true);
    // IF a device sends a 'fire and forget' telemetry message
    final ProtonDelivery delivery = mock(ProtonDelivery.class);
    when(delivery.remotelySettled()).thenReturn(true);
    final Buffer payload = Buffer.buffer("payload");
    final String to = ResourceIdentifier.from(TelemetryConstants.TELEMETRY_ENDPOINT, TEST_TENANT_ID, TEST_DEVICE).toString();
    adapter.onMessageReceived(AmqpContext.fromMessage(delivery, getFakeMessage(to, payload), span, null)).onComplete(ctx.succeeding(d -> {
        ctx.verify(() -> {
            // THEN the adapter has forwarded the message downstream
            assertTelemetryMessageHasBeenSentDownstream(QoS.AT_MOST_ONCE, TEST_TENANT_ID, TEST_DEVICE, "text/plain");
            // and acknowledged the message to the device
            verify(delivery).disposition(any(Accepted.class), eq(true));
            // and has reported the telemetry message
            verify(metrics).reportTelemetry(eq(EndpointType.TELEMETRY), eq(TEST_TENANT_ID), eq(tenantObject), eq(ProcessingOutcome.FORWARDED), eq(MetricsTags.QoS.AT_MOST_ONCE), eq(payload.length()), any());
        });
        ctx.completeNow();
    }));
}
Also used : Buffer(io.vertx.core.buffer.Buffer) HttpURLConnection(java.net.HttpURLConnection) ProtonConnection(io.vertx.proton.ProtonConnection) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) LifecycleChange(org.eclipse.hono.notification.deviceregistry.LifecycleChange) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ProcessingOutcome(org.eclipse.hono.service.metric.MetricsTags.ProcessingOutcome) MessagingType(org.eclipse.hono.util.MessagingType) EventBus(io.vertx.core.eventbus.EventBus) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Map(java.util.Map) DeliveryState(org.apache.qpid.proton.amqp.transport.DeliveryState) AmqpError(org.apache.qpid.proton.amqp.transport.AmqpError) CommandContext(org.eclipse.hono.client.command.CommandContext) RegistrationAssertion(org.eclipse.hono.util.RegistrationAssertion) EventConstants(org.eclipse.hono.util.EventConstants) VertxMockSupport(org.eclipse.hono.test.VertxMockSupport) Span(io.opentracing.Span) NotificationEventBusSupport(org.eclipse.hono.notification.NotificationEventBusSupport) Mockito.mock(org.mockito.Mockito.mock) VertxTestContext(io.vertx.junit5.VertxTestContext) Rejected(org.apache.qpid.proton.amqp.messaging.Rejected) Target(org.apache.qpid.proton.amqp.messaging.Target) ArgumentMatchers.anyBoolean(org.mockito.ArgumentMatchers.anyBoolean) Commands(org.eclipse.hono.client.command.Commands) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) AsyncResult(io.vertx.core.AsyncResult) CommandConstants(org.eclipse.hono.util.CommandConstants) Direction(org.eclipse.hono.service.metric.MetricsTags.Direction) Vertx(io.vertx.core.Vertx) Mockito.times(org.mockito.Mockito.times) ProtonHelper(io.vertx.proton.ProtonHelper) Released(org.apache.qpid.proton.amqp.messaging.Released) SpanContext(io.opentracing.SpanContext) Mockito.never(org.mockito.Mockito.never) ConnectionAttemptOutcome(org.eclipse.hono.service.metric.MetricsTags.ConnectionAttemptOutcome) ResourceLimitChecks(org.eclipse.hono.adapter.resourcelimits.ResourceLimitChecks) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) ProtonReceiver(io.vertx.proton.ProtonReceiver) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) Context(io.vertx.core.Context) ProtonServer(io.vertx.proton.ProtonServer) Timeout(io.vertx.junit5.Timeout) EndpointType(org.eclipse.hono.service.metric.MetricsTags.EndpointType) NotificationType(org.eclipse.hono.notification.NotificationType) TracingMockSupport(org.eclipse.hono.test.TracingMockSupport) ResourceIdentifier(org.eclipse.hono.util.ResourceIdentifier) Binary(org.apache.qpid.proton.amqp.Binary) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) Data(org.apache.qpid.proton.amqp.messaging.Data) MetricsTags(org.eclipse.hono.service.metric.MetricsTags) ProtonQoS(io.vertx.proton.ProtonQoS) Instant(java.time.Instant) MessageHelper(org.eclipse.hono.util.MessageHelper) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) Device(org.eclipse.hono.auth.Device) Test(org.junit.jupiter.api.Test) ErrorCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition) Buffer(io.vertx.core.buffer.Buffer) CommandConsumer(org.eclipse.hono.client.command.CommandConsumer) Mockito.inOrder(org.mockito.Mockito.inOrder) ProtonSender(io.vertx.proton.ProtonSender) Accepted(org.apache.qpid.proton.amqp.messaging.Accepted) QoS(org.eclipse.hono.util.QoS) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) AbstractNotification(org.eclipse.hono.notification.AbstractNotification) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ProtonDelivery(io.vertx.proton.ProtonDelivery) ConnectionLimitManager(org.eclipse.hono.adapter.limiting.ConnectionLimitManager) HashMap(java.util.HashMap) ClientErrorException(org.eclipse.hono.client.ClientErrorException) ConnectionEventProducer(org.eclipse.hono.adapter.monitoring.ConnectionEventProducer) CommandResponseSender(org.eclipse.hono.client.command.CommandResponseSender) Constants(org.eclipse.hono.util.Constants) ProtocolAdapterTestSupport(org.eclipse.hono.adapter.test.ProtocolAdapterTestSupport) TelemetryConstants(org.eclipse.hono.util.TelemetryConstants) ArgumentCaptor(org.mockito.ArgumentCaptor) RecordImpl(org.apache.qpid.proton.engine.impl.RecordImpl) Message(org.apache.qpid.proton.message.Message) HttpUtils(org.eclipse.hono.service.http.HttpUtils) TenantChangeNotification(org.eclipse.hono.notification.deviceregistry.TenantChangeNotification) InOrder(org.mockito.InOrder) Promise(io.vertx.core.Promise) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) ApplicationProperties(org.apache.qpid.proton.amqp.messaging.ApplicationProperties) CommandResponse(org.eclipse.hono.client.command.CommandResponse) TenantObject(org.eclipse.hono.util.TenantObject) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Source(org.apache.qpid.proton.amqp.transport.Source) Adapter(org.eclipse.hono.util.Adapter) Handler(io.vertx.core.Handler) Record(org.apache.qpid.proton.engine.Record) TenantObject(org.eclipse.hono.util.TenantObject) ProtonDelivery(io.vertx.proton.ProtonDelivery) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.jupiter.api.Test)

Aggregations

Device (org.eclipse.hono.auth.Device)115 HttpURLConnection (java.net.HttpURLConnection)74 Test (org.junit.jupiter.api.Test)72 Future (io.vertx.core.Future)69 ClientErrorException (org.eclipse.hono.client.ClientErrorException)67 Buffer (io.vertx.core.buffer.Buffer)66 Handler (io.vertx.core.Handler)63 TenantObject (org.eclipse.hono.util.TenantObject)63 Promise (io.vertx.core.Promise)59 Constants (org.eclipse.hono.util.Constants)58 Span (io.opentracing.Span)55 RegistrationAssertion (org.eclipse.hono.util.RegistrationAssertion)55 SpanContext (io.opentracing.SpanContext)53 VertxTestContext (io.vertx.junit5.VertxTestContext)52 VertxExtension (io.vertx.junit5.VertxExtension)51 MessageHelper (org.eclipse.hono.util.MessageHelper)51 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)51 Mockito.when (org.mockito.Mockito.when)51 Truth.assertThat (com.google.common.truth.Truth.assertThat)50 ResourceIdentifier (org.eclipse.hono.util.ResourceIdentifier)47