Search in sources :

Example 11 with ProtonMessageHandler

use of io.vertx.proton.ProtonMessageHandler in project hono by eclipse.

the class ProtonBasedApplicationClientTest method testCreateTelemetryConsumerReleasesMessageOnException.

/**
 * Verifies that the message consumer created by the factory catches an exception
 * thrown by the client provided handler and releases the message.
 *
 * @param ctx The vert.x test context.
 */
@Test
@SuppressWarnings("unchecked")
void testCreateTelemetryConsumerReleasesMessageOnException(final VertxTestContext ctx) {
    // GIVEN a client provided message handler that throws an exception on
    // each message received
    final Handler<DownstreamMessage<AmqpMessageContext>> consumer = VertxMockSupport.mockHandler();
    doThrow(new IllegalArgumentException("message does not contain required properties"), new ClientErrorException(HttpURLConnection.HTTP_BAD_REQUEST)).when(consumer).handle(any(DownstreamMessage.class));
    client.createTelemetryConsumer("tenant", consumer, t -> {
    }).onComplete(ctx.succeeding(mc -> {
        final ArgumentCaptor<ProtonMessageHandler> messageHandler = ArgumentCaptor.forClass(ProtonMessageHandler.class);
        ctx.verify(() -> {
            verify(connection).createReceiver(eq("telemetry/tenant"), eq(ProtonQoS.AT_LEAST_ONCE), messageHandler.capture(), anyInt(), anyBoolean(), VertxMockSupport.anyHandler());
            final var msg = ProtonHelper.message();
            // WHEN a message is received and the client provided consumer
            // throws an IllegalArgumentException
            var delivery = mock(ProtonDelivery.class);
            messageHandler.getValue().handle(delivery, msg);
            // THEN the message is forwarded to the client provided handler
            verify(consumer).handle(any(DownstreamMessage.class));
            // AND the AMQP message is being released
            verify(delivery).disposition(any(Released.class), eq(Boolean.TRUE));
            // WHEN a message is received and the client provided consumer
            // throws a ClientErrorException
            delivery = mock(ProtonDelivery.class);
            messageHandler.getValue().handle(delivery, msg);
            // THEN the message is forwarded to the client provided handler
            verify(consumer, times(2)).handle(any(DownstreamMessage.class));
            // AND the AMQP message is being rejected
            verify(delivery).disposition(any(Rejected.class), eq(Boolean.TRUE));
        });
        ctx.completeNow();
    }));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) HttpURLConnection(java.net.HttpURLConnection) VertxTestContext(io.vertx.junit5.VertxTestContext) ProtonReceiver(io.vertx.proton.ProtonReceiver) BeforeEach(org.junit.jupiter.api.BeforeEach) DownstreamMessage(org.eclipse.hono.application.client.DownstreamMessage) ProtonDelivery(io.vertx.proton.ProtonDelivery) Rejected(org.apache.qpid.proton.amqp.messaging.Rejected) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) AmqpClientUnitTestHelper(org.eclipse.hono.client.amqp.test.AmqpClientUnitTestHelper) ClientErrorException(org.eclipse.hono.client.ClientErrorException) ArgumentMatchers.anyBoolean(org.mockito.ArgumentMatchers.anyBoolean) Timeout(io.vertx.junit5.Timeout) Mockito.doThrow(org.mockito.Mockito.doThrow) ArgumentCaptor(org.mockito.ArgumentCaptor) EventBus(io.vertx.core.eventbus.EventBus) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Modified(org.apache.qpid.proton.amqp.messaging.Modified) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) DisconnectListener(org.eclipse.hono.client.DisconnectListener) AsyncResult(io.vertx.core.AsyncResult) HonoConnection(org.eclipse.hono.client.HonoConnection) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) Promise(io.vertx.core.Promise) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Vertx(io.vertx.core.Vertx) Mockito.times(org.mockito.Mockito.times) ProtonHelper(io.vertx.proton.ProtonHelper) ProtonQoS(io.vertx.proton.ProtonQoS) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) VertxExtension(io.vertx.junit5.VertxExtension) Released(org.apache.qpid.proton.amqp.messaging.Released) Future(io.vertx.core.Future) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Test(org.junit.jupiter.api.Test) VertxMockSupport(org.eclipse.hono.test.VertxMockSupport) ProtonSender(io.vertx.proton.ProtonSender) Handler(io.vertx.core.Handler) Accepted(org.apache.qpid.proton.amqp.messaging.Accepted) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) DownstreamMessage(org.eclipse.hono.application.client.DownstreamMessage) ArgumentCaptor(org.mockito.ArgumentCaptor) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) ProtonDelivery(io.vertx.proton.ProtonDelivery) ClientErrorException(org.eclipse.hono.client.ClientErrorException) Test(org.junit.jupiter.api.Test)

Example 12 with ProtonMessageHandler

use of io.vertx.proton.ProtonMessageHandler in project hono by eclipse.

the class CommandAndControlAmqpIT method connectAndSubscribe.

private void connectAndSubscribe(final VertxTestContext ctx, final String commandTargetDeviceId, final AmqpCommandEndpointConfiguration endpointConfig, final BiFunction<ProtonReceiver, ProtonSender, ProtonMessageHandler> commandConsumerFactory, final int expectedNoOfCommands) throws InterruptedException {
    final VertxTestContext setup = new VertxTestContext();
    final Checkpoint setupDone = setup.checkpoint();
    final Checkpoint notificationReceived = setup.checkpoint();
    connectToAdapter(tenantId, deviceId, password, () -> createEventConsumer(tenantId, msg -> {
        // expect empty notification with TTD -1
        ctx.verify(() -> assertThat(msg.getContentType()).isEqualTo(EventConstants.CONTENT_TYPE_EMPTY_NOTIFICATION));
        final TimeUntilDisconnectNotification notification = msg.getTimeUntilDisconnectNotification().orElse(null);
        log.debug("received notification [{}]", notification);
        ctx.verify(() -> assertThat(notification).isNotNull());
        if (notification.getTtd() == -1) {
            notificationReceived.flag();
        }
    })).compose(con -> createProducer(null, ProtonQoS.AT_LEAST_ONCE)).compose(sender -> subscribeToCommands(endpointConfig, tenantId, commandTargetDeviceId).map(recv -> {
        recv.handler(commandConsumerFactory.apply(recv, sender));
        // make sure that there are always enough credits, even if commands are sent faster than answered
        recv.flow(expectedNoOfCommands);
        return null;
    })).onComplete(setup.succeeding(v -> setupDone.flag()));
    assertWithMessage("connect and subscribe finished within %s seconds", IntegrationTestSupport.getTestSetupTimeout()).that(setup.awaitCompletion(IntegrationTestSupport.getTestSetupTimeout(), TimeUnit.SECONDS)).isTrue();
    if (setup.failed()) {
        ctx.failNow(setup.causeOfFailure());
    }
}
Also used : HttpURLConnection(java.net.HttpURLConnection) ProtonConnection(io.vertx.proton.ProtonConnection) ProtonReceiver(io.vertx.proton.ProtonReceiver) BeforeEach(org.junit.jupiter.api.BeforeEach) DownstreamMessage(org.eclipse.hono.application.client.DownstreamMessage) BiFunction(java.util.function.BiFunction) Tenant(org.eclipse.hono.service.management.tenant.Tenant) HonoProtonHelper(org.eclipse.hono.util.HonoProtonHelper) Timeout(io.vertx.junit5.Timeout) MessagingType(org.eclipse.hono.util.MessagingType) IntegrationTestSupport(org.eclipse.hono.tests.IntegrationTestSupport) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) Duration(java.time.Duration) Map(java.util.Map) AmqpError(org.apache.qpid.proton.amqp.transport.AmqpError) MethodSource(org.junit.jupiter.params.provider.MethodSource) ResourceLimits(org.eclipse.hono.util.ResourceLimits) 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) ProtonQoS(io.vertx.proton.ProtonQoS) MessageHelper(org.eclipse.hono.util.MessageHelper) VertxExtension(io.vertx.junit5.VertxExtension) EventConstants(org.eclipse.hono.util.EventConstants) Future(io.vertx.core.Future) Test(org.junit.jupiter.api.Test) CountDownLatch(java.util.concurrent.CountDownLatch) ErrorCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition) Stream(java.util.stream.Stream) Buffer(io.vertx.core.buffer.Buffer) Optional(java.util.Optional) ProtonSender(io.vertx.proton.ProtonSender) Checkpoint(io.vertx.junit5.Checkpoint) Accepted(org.apache.qpid.proton.amqp.messaging.Accepted) VertxTestContext(io.vertx.junit5.VertxTestContext) GenericKafkaSender(org.eclipse.hono.tests.GenericKafkaSender) Rejected(org.apache.qpid.proton.amqp.messaging.Rejected) ClientErrorException(org.eclipse.hono.client.ClientErrorException) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Constants(org.eclipse.hono.util.Constants) TimeUntilDisconnectNotification(org.eclipse.hono.util.TimeUntilDisconnectNotification) Message(org.apache.qpid.proton.message.Message) Promise(io.vertx.core.Promise) ServerErrorException(org.eclipse.hono.client.ServerErrorException) ProtonHelper(io.vertx.proton.ProtonHelper) KafkaRecordHelper(org.eclipse.hono.client.kafka.KafkaRecordHelper) Truth.assertThat(com.google.common.truth.Truth.assertThat) AssumeMessagingSystem(org.eclipse.hono.tests.AssumeMessagingSystem) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) HonoTopic(org.eclipse.hono.client.kafka.HonoTopic) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MessageConsumer(org.eclipse.hono.application.client.MessageConsumer) SendMessageTimeoutException(org.eclipse.hono.client.SendMessageTimeoutException) NoopSpan(io.opentracing.noop.NoopSpan) GenericSenderLink(org.eclipse.hono.client.amqp.GenericSenderLink) Handler(io.vertx.core.Handler) Checkpoint(io.vertx.junit5.Checkpoint) VertxTestContext(io.vertx.junit5.VertxTestContext) TimeUntilDisconnectNotification(org.eclipse.hono.util.TimeUntilDisconnectNotification)

Example 13 with ProtonMessageHandler

use of io.vertx.proton.ProtonMessageHandler in project hono by eclipse.

the class ProtonBasedNotificationReceiverTest method testThatCorrectHandlerIsInvoked.

/**
 * Verifies that the receiver decodes the notifications it receives and invokes the correct handler.
 *
 * @param ctx The vert.x test context.
 */
@Test
public void testThatCorrectHandlerIsInvoked(final VertxTestContext ctx) {
    final String tenantId = "my-tenant";
    final String deviceId = "my-device";
    final Instant creationTime = Instant.parse("2007-12-03T10:15:30Z");
    final TenantChangeNotification tenantChangeNotification = new TenantChangeNotification(LifecycleChange.CREATE, tenantId, creationTime, false);
    final Message tenantChangeNotificationMsg = ProtonHelper.message();
    MessageHelper.setJsonPayload(tenantChangeNotificationMsg, JsonObject.mapFrom(tenantChangeNotification));
    final DeviceChangeNotification deviceChangeNotification = new DeviceChangeNotification(LifecycleChange.CREATE, tenantId, deviceId, creationTime, false);
    final Message deviceChangeNotificationMsg = ProtonHelper.message();
    MessageHelper.setJsonPayload(deviceChangeNotificationMsg, JsonObject.mapFrom(deviceChangeNotification));
    final CredentialsChangeNotification credentialsChangeNotification = new CredentialsChangeNotification(tenantId, deviceId, creationTime);
    final Message credentialsChangeNotificationMsg = ProtonHelper.message();
    MessageHelper.setJsonPayload(credentialsChangeNotificationMsg, JsonObject.mapFrom(credentialsChangeNotification));
    final AllDevicesOfTenantDeletedNotification allDevicesOfTenantDeletedChangeNotification = new AllDevicesOfTenantDeletedNotification(tenantId, creationTime);
    final Message allDevicesOfTenantDeletedChangeNotificationMsg = ProtonHelper.message();
    MessageHelper.setJsonPayload(allDevicesOfTenantDeletedChangeNotificationMsg, JsonObject.mapFrom(allDevicesOfTenantDeletedChangeNotification));
    final Checkpoint handlerInvokedCheckpoint = ctx.checkpoint(4);
    client.registerConsumer(TenantChangeNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(TenantChangeNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    client.registerConsumer(DeviceChangeNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(DeviceChangeNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    client.registerConsumer(CredentialsChangeNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(CredentialsChangeNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    client.registerConsumer(AllDevicesOfTenantDeletedNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(AllDevicesOfTenantDeletedNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    // WHEN starting the client
    client.start().onComplete(ctx.succeeding(v -> ctx.verify(() -> {
        // THEN the receiver links got created
        final Map<String, ProtonMessageHandler> receiverMsgHandlersPerAddress = assertReceiverLinkCreated(connection);
        assertThat(receiverMsgHandlersPerAddress).containsKey(NotificationAddressHelper.getAddress(TenantChangeNotification.TYPE));
        assertThat(receiverMsgHandlersPerAddress).containsKey(NotificationAddressHelper.getAddress(DeviceChangeNotification.TYPE));
        assertThat(receiverMsgHandlersPerAddress).containsKey(NotificationAddressHelper.getAddress(CredentialsChangeNotification.TYPE));
        assertThat(receiverMsgHandlersPerAddress).containsKey(NotificationAddressHelper.getAddress(AllDevicesOfTenantDeletedNotification.TYPE));
        final ProtonMessageHandler tenantChangeReceiverMsgHandler = receiverMsgHandlersPerAddress.get(NotificationAddressHelper.getAddress(TenantChangeNotification.TYPE));
        final ProtonMessageHandler deviceChangeReceiverMsgHandler = receiverMsgHandlersPerAddress.get(NotificationAddressHelper.getAddress(DeviceChangeNotification.TYPE));
        final ProtonMessageHandler credentialsChangeReceiverMsgHandler = receiverMsgHandlersPerAddress.get(NotificationAddressHelper.getAddress(CredentialsChangeNotification.TYPE));
        final ProtonMessageHandler allDevicesOfTenantDeletedChangeReceiverMsgHandler = receiverMsgHandlersPerAddress.get(NotificationAddressHelper.getAddress(AllDevicesOfTenantDeletedNotification.TYPE));
        // and sending notifications on the links
        tenantChangeReceiverMsgHandler.handle(mock(ProtonDelivery.class), tenantChangeNotificationMsg);
        deviceChangeReceiverMsgHandler.handle(mock(ProtonDelivery.class), deviceChangeNotificationMsg);
        credentialsChangeReceiverMsgHandler.handle(mock(ProtonDelivery.class), credentialsChangeNotificationMsg);
        allDevicesOfTenantDeletedChangeReceiverMsgHandler.handle(mock(ProtonDelivery.class), allDevicesOfTenantDeletedChangeNotificationMsg);
    // causes the client to receive the notifications and the handlerInvokedCheckpoint to get flagged
    })));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) VertxTestContext(io.vertx.junit5.VertxTestContext) ProtonReceiver(io.vertx.proton.ProtonReceiver) BeforeEach(org.junit.jupiter.api.BeforeEach) LifecycleChange(org.eclipse.hono.notification.deviceregistry.LifecycleChange) ProtonDelivery(io.vertx.proton.ProtonDelivery) AmqpClientUnitTestHelper(org.eclipse.hono.client.amqp.test.AmqpClientUnitTestHelper) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Timeout(io.vertx.junit5.Timeout) ArgumentCaptor(org.mockito.ArgumentCaptor) EventBus(io.vertx.core.eventbus.EventBus) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) Map(java.util.Map) Message(org.apache.qpid.proton.message.Message) TracingMockSupport(org.eclipse.hono.test.TracingMockSupport) JsonObject(io.vertx.core.json.JsonObject) HonoConnection(org.eclipse.hono.client.HonoConnection) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) CredentialsChangeNotification(org.eclipse.hono.notification.deviceregistry.CredentialsChangeNotification) TenantChangeNotification(org.eclipse.hono.notification.deviceregistry.TenantChangeNotification) RequestResponseClientConfigProperties(org.eclipse.hono.client.RequestResponseClientConfigProperties) Tracer(io.opentracing.Tracer) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Vertx(io.vertx.core.Vertx) ProtonHelper(io.vertx.proton.ProtonHelper) ProtonQoS(io.vertx.proton.ProtonQoS) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) Instant(java.time.Instant) MessageHelper(org.eclipse.hono.util.MessageHelper) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Test(org.junit.jupiter.api.Test) List(java.util.List) VertxMockSupport(org.eclipse.hono.test.VertxMockSupport) Checkpoint(io.vertx.junit5.Checkpoint) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) Checkpoint(io.vertx.junit5.Checkpoint) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) Message(org.apache.qpid.proton.message.Message) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) ProtonDelivery(io.vertx.proton.ProtonDelivery) Instant(java.time.Instant) CredentialsChangeNotification(org.eclipse.hono.notification.deviceregistry.CredentialsChangeNotification) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) TenantChangeNotification(org.eclipse.hono.notification.deviceregistry.TenantChangeNotification) Test(org.junit.jupiter.api.Test)

Example 14 with ProtonMessageHandler

use of io.vertx.proton.ProtonMessageHandler in project hono by eclipse.

the class ProtonBasedNotificationReceiverTest method testRegisterCommandConsumer.

/**
 * Verifies that the client with a registered consumer receives notification messages.
 *
 * @param ctx The vert.x test context.
 */
@Test
public void testRegisterCommandConsumer(final VertxTestContext ctx) {
    final String tenantId = "my-tenant";
    final Instant creationTime = Instant.parse("2007-12-03T10:15:30Z");
    final TenantChangeNotification notification = new TenantChangeNotification(LifecycleChange.CREATE, tenantId, creationTime, false);
    final Message notificationMessage = ProtonHelper.message();
    MessageHelper.setJsonPayload(notificationMessage, JsonObject.mapFrom(notification));
    // GIVEN a client where a TenantChangeNotification consumer gets registered
    final AtomicReference<TenantChangeNotification> receivedNotificationRef = new AtomicReference<>();
    client.registerConsumer(TenantChangeNotification.TYPE, receivedNotificationRef::set);
    // WHEN starting the client
    client.start().onComplete(ctx.succeeding(v -> {
        ctx.verify(() -> {
            // THEN a receiver link got created
            final ProtonMessageHandler receiverMessageHandler = AmqpClientUnitTestHelper.assertReceiverLinkCreated(connection);
            // and sending a notification on the link
            receiverMessageHandler.handle(mock(ProtonDelivery.class), notificationMessage);
            // causes the client to receive the notification
            assertThat(receivedNotificationRef.get()).isNotNull();
        });
        ctx.completeNow();
    }));
}
Also used : ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) VertxTestContext(io.vertx.junit5.VertxTestContext) ProtonReceiver(io.vertx.proton.ProtonReceiver) BeforeEach(org.junit.jupiter.api.BeforeEach) LifecycleChange(org.eclipse.hono.notification.deviceregistry.LifecycleChange) ProtonDelivery(io.vertx.proton.ProtonDelivery) AmqpClientUnitTestHelper(org.eclipse.hono.client.amqp.test.AmqpClientUnitTestHelper) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Timeout(io.vertx.junit5.Timeout) ArgumentCaptor(org.mockito.ArgumentCaptor) EventBus(io.vertx.core.eventbus.EventBus) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) Map(java.util.Map) Message(org.apache.qpid.proton.message.Message) TracingMockSupport(org.eclipse.hono.test.TracingMockSupport) JsonObject(io.vertx.core.json.JsonObject) HonoConnection(org.eclipse.hono.client.HonoConnection) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) CredentialsChangeNotification(org.eclipse.hono.notification.deviceregistry.CredentialsChangeNotification) TenantChangeNotification(org.eclipse.hono.notification.deviceregistry.TenantChangeNotification) RequestResponseClientConfigProperties(org.eclipse.hono.client.RequestResponseClientConfigProperties) Tracer(io.opentracing.Tracer) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Vertx(io.vertx.core.Vertx) ProtonHelper(io.vertx.proton.ProtonHelper) ProtonQoS(io.vertx.proton.ProtonQoS) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) Instant(java.time.Instant) MessageHelper(org.eclipse.hono.util.MessageHelper) VertxExtension(io.vertx.junit5.VertxExtension) Future(io.vertx.core.Future) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Test(org.junit.jupiter.api.Test) List(java.util.List) VertxMockSupport(org.eclipse.hono.test.VertxMockSupport) Checkpoint(io.vertx.junit5.Checkpoint) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) Message(org.apache.qpid.proton.message.Message) Instant(java.time.Instant) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) TenantChangeNotification(org.eclipse.hono.notification.deviceregistry.TenantChangeNotification) Test(org.junit.jupiter.api.Test)

Aggregations

ProtonMessageHandler (io.vertx.proton.ProtonMessageHandler)14 ProtonReceiver (io.vertx.proton.ProtonReceiver)13 Vertx (io.vertx.core.Vertx)11 Future (io.vertx.core.Future)9 ProtonDelivery (io.vertx.proton.ProtonDelivery)9 Message (org.apache.qpid.proton.message.Message)9 Handler (io.vertx.core.Handler)8 ProtonQoS (io.vertx.proton.ProtonQoS)8 ProtonHelper (io.vertx.proton.ProtonHelper)7 Truth.assertThat (com.google.common.truth.Truth.assertThat)5 Timeout (io.vertx.junit5.Timeout)5 VertxExtension (io.vertx.junit5.VertxExtension)5 VertxTestContext (io.vertx.junit5.VertxTestContext)5 HttpURLConnection (java.net.HttpURLConnection)5 TimeUnit (java.util.concurrent.TimeUnit)5 MessageHelper (org.eclipse.hono.util.MessageHelper)5 Test (org.junit.Test)5 BeforeEach (org.junit.jupiter.api.BeforeEach)5 Test (org.junit.jupiter.api.Test)5 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)5