Search in sources :

Example 6 with DeviceChangeNotification

use of org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification in project hono by eclipse.

the class ProtonBasedDeviceRegistrationClientTest method testDeviceChangeNotificationRemovesValueFromCache.

/**
 * Verifies that the client removes registrations of a device from the cache if it receives a notification about a
 * change in that device.
 *
 * @param ctx The vert.x test context.
 */
@Test
public void testDeviceChangeNotificationRemovesValueFromCache(final VertxTestContext ctx) {
    final String tenantId = "the-tenant-id";
    final String deviceId = "the-device-id";
    givenAClient(cache);
    final var notificationHandlerCaptor = getEventBusConsumerHandlerArgumentCaptor(DeviceChangeNotification.TYPE);
    final Set<AnnotatedCacheKey<?>> expectedCacheRemovals = new HashSet<>();
    // GIVEN a client with a cache containing device registrations of two tenants
    client.start().compose(v -> addResultToCache("other-tenant", deviceId, "gateway-id")).compose(v -> addResultToCache(tenantId, "other-device", "gateway-id")).compose(v -> addResultToCache(tenantId, deviceId, "gateway-id")).map(expectedCacheRemovals::add).compose(v -> addResultToCache(tenantId, deviceId, "other-gateway")).map(expectedCacheRemovals::add).onComplete(ctx.succeeding(ok -> ctx.verify(() -> {
        // WHEN receiving a notification about a change on the device
        sendViaEventBusMock(new DeviceChangeNotification(LifecycleChange.UPDATE, tenantId, deviceId, Instant.now(), false), notificationHandlerCaptor.getValue());
        // THEN the cache is invalidated for registrations of the changed device and not for other devices
        ctx.verify(() -> verify(cache).invalidateAll(expectedCacheRemovals));
        ctx.completeNow();
    })));
}
Also used : HttpURLConnection(java.net.HttpURLConnection) ProtonReceiver(io.vertx.proton.ProtonReceiver) BeforeEach(org.junit.jupiter.api.BeforeEach) LifecycleChange(org.eclipse.hono.notification.deviceregistry.LifecycleChange) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) Timeout(io.vertx.junit5.Timeout) EventBus(io.vertx.core.eventbus.EventBus) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) RegistrationResult(org.eclipse.hono.util.RegistrationResult) NotificationType(org.eclipse.hono.notification.NotificationType) TracingMockSupport(org.eclipse.hono.test.TracingMockSupport) JsonObject(io.vertx.core.json.JsonObject) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) 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) Test(org.junit.jupiter.api.Test) VertxMockSupport(org.eclipse.hono.test.VertxMockSupport) Span(io.opentracing.Span) ProtonSender(io.vertx.proton.ProtonSender) NotificationEventBusSupport(org.eclipse.hono.notification.NotificationEventBusSupport) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) AbstractNotification(org.eclipse.hono.notification.AbstractNotification) CacheDirective(org.eclipse.hono.util.CacheDirective) VertxTestContext(io.vertx.junit5.VertxTestContext) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ProtonDelivery(io.vertx.proton.ProtonDelivery) AmqpClientUnitTestHelper(org.eclipse.hono.client.amqp.test.AmqpClientUnitTestHelper) Cache(com.github.benmanes.caffeine.cache.Cache) Constants(org.eclipse.hono.util.Constants) ConcurrentMap(java.util.concurrent.ConcurrentMap) HashSet(java.util.HashSet) ArgumentCaptor(org.mockito.ArgumentCaptor) Message(org.apache.qpid.proton.message.Message) HonoConnection(org.eclipse.hono.client.HonoConnection) RequestResponseClientConfigProperties(org.eclipse.hono.client.RequestResponseClientConfigProperties) Tracer(io.opentracing.Tracer) Vertx(io.vertx.core.Vertx) RegistrationConstants(org.eclipse.hono.util.RegistrationConstants) ProtonHelper(io.vertx.proton.ProtonHelper) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Mockito.never(org.mockito.Mockito.never) AnnotatedCacheKey(org.eclipse.hono.client.util.AnnotatedCacheKey) SendMessageSampler(org.eclipse.hono.client.SendMessageSampler) Handler(io.vertx.core.Handler) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) AnnotatedCacheKey(org.eclipse.hono.client.util.AnnotatedCacheKey) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 7 with DeviceChangeNotification

use of org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification in project hono by eclipse.

the class ProtonBasedDeviceRegistrationClientTest method testDeviceChangeNotificationRemovesGatewaysFromCache.

/**
 * Verifies that the client removes registrations of a gateway from the cache if it receives a notification about a
 * change in that gateway.
 *
 * @param ctx The vert.x test context.
 */
@Test
public void testDeviceChangeNotificationRemovesGatewaysFromCache(final VertxTestContext ctx) {
    final String tenantId = "the-tenant-id";
    final String deviceId = "the-device-id";
    final String gatewayId = "the-device-id";
    givenAClient(cache);
    final var notificationHandlerCaptor = getEventBusConsumerHandlerArgumentCaptor(DeviceChangeNotification.TYPE);
    final Set<AnnotatedCacheKey<?>> expectedCacheRemovals = new HashSet<>();
    // GIVEN a client with a cache containing device registrations of two tenants
    client.start().compose(v -> addResultToCache("other-tenant", deviceId, "gateway-id")).compose(v -> addResultToCache(tenantId, "other-device", "gateway-id")).compose(v -> addResultToCache(tenantId, deviceId, gatewayId)).map(expectedCacheRemovals::add).compose(v -> addResultToCache(tenantId, gatewayId, "other-gateway")).map(expectedCacheRemovals::add).onComplete(ctx.succeeding(ok -> ctx.verify(() -> {
        // WHEN receiving a notification about a change on the gateway device
        sendViaEventBusMock(new DeviceChangeNotification(LifecycleChange.UPDATE, tenantId, gatewayId, Instant.now(), false), notificationHandlerCaptor.getValue());
        // THEN the cache is invalidated for registrations where the device id matches the gateway id or the
        // device id and no other registrations
        ctx.verify(() -> verify(cache).invalidateAll(expectedCacheRemovals));
        ctx.completeNow();
    })));
}
Also used : HttpURLConnection(java.net.HttpURLConnection) ProtonReceiver(io.vertx.proton.ProtonReceiver) BeforeEach(org.junit.jupiter.api.BeforeEach) LifecycleChange(org.eclipse.hono.notification.deviceregistry.LifecycleChange) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) Timeout(io.vertx.junit5.Timeout) EventBus(io.vertx.core.eventbus.EventBus) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) ProtonMessageHandler(io.vertx.proton.ProtonMessageHandler) RegistrationResult(org.eclipse.hono.util.RegistrationResult) NotificationType(org.eclipse.hono.notification.NotificationType) TracingMockSupport(org.eclipse.hono.test.TracingMockSupport) JsonObject(io.vertx.core.json.JsonObject) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) 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) Test(org.junit.jupiter.api.Test) VertxMockSupport(org.eclipse.hono.test.VertxMockSupport) Span(io.opentracing.Span) ProtonSender(io.vertx.proton.ProtonSender) NotificationEventBusSupport(org.eclipse.hono.notification.NotificationEventBusSupport) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) AbstractNotification(org.eclipse.hono.notification.AbstractNotification) CacheDirective(org.eclipse.hono.util.CacheDirective) VertxTestContext(io.vertx.junit5.VertxTestContext) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ProtonDelivery(io.vertx.proton.ProtonDelivery) AmqpClientUnitTestHelper(org.eclipse.hono.client.amqp.test.AmqpClientUnitTestHelper) Cache(com.github.benmanes.caffeine.cache.Cache) Constants(org.eclipse.hono.util.Constants) ConcurrentMap(java.util.concurrent.ConcurrentMap) HashSet(java.util.HashSet) ArgumentCaptor(org.mockito.ArgumentCaptor) Message(org.apache.qpid.proton.message.Message) HonoConnection(org.eclipse.hono.client.HonoConnection) RequestResponseClientConfigProperties(org.eclipse.hono.client.RequestResponseClientConfigProperties) Tracer(io.opentracing.Tracer) Vertx(io.vertx.core.Vertx) RegistrationConstants(org.eclipse.hono.util.RegistrationConstants) ProtonHelper(io.vertx.proton.ProtonHelper) Mockito.when(org.mockito.Mockito.when) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Mockito.never(org.mockito.Mockito.never) AnnotatedCacheKey(org.eclipse.hono.client.util.AnnotatedCacheKey) SendMessageSampler(org.eclipse.hono.client.SendMessageSampler) Handler(io.vertx.core.Handler) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) AnnotatedCacheKey(org.eclipse.hono.client.util.AnnotatedCacheKey) HashSet(java.util.HashSet) Test(org.junit.jupiter.api.Test)

Example 8 with DeviceChangeNotification

use of org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification 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 9 with DeviceChangeNotification

use of org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification in project hono by eclipse.

the class KafkaBasedNotificationSenderTest method testProducerRecordForDeviceNotification.

/**
 * Verifies that the expected Kafka record is created when publishing a {@link DeviceChangeNotification}.
 *
 * @param ctx The vert.x test context.
 */
@Test
public void testProducerRecordForDeviceNotification(final VertxTestContext ctx) {
    final DeviceChangeNotification notification = new DeviceChangeNotification(CHANGE, TENANT_ID, DEVICE_ID, CREATION_TIME, ENABLED);
    testProducerRecordForNotification(ctx, notification, DEVICE_ID);
}
Also used : DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) Test(org.junit.jupiter.api.Test)

Example 10 with DeviceChangeNotification

use of org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification in project hono by eclipse.

the class KafkaBasedNotificationReceiverTest 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");
    mockConsumer.schedulePollTask(() -> {
        mockConsumer.addRecord(createKafkaRecord(new TenantChangeNotification(LifecycleChange.CREATE, tenantId, creationTime, false), 0L));
        mockConsumer.addRecord(createKafkaRecord(new DeviceChangeNotification(LifecycleChange.CREATE, tenantId, deviceId, creationTime, false), 0L));
        mockConsumer.addRecord(createKafkaRecord(new CredentialsChangeNotification(tenantId, deviceId, creationTime), 1L));
        mockConsumer.addRecord(createKafkaRecord(new AllDevicesOfTenantDeletedNotification(tenantId, creationTime), 2L));
    });
    final var receiver = createReceiver();
    final Checkpoint handlerInvokedCheckpoint = ctx.checkpoint(4);
    receiver.registerConsumer(TenantChangeNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(TenantChangeNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    receiver.registerConsumer(DeviceChangeNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(DeviceChangeNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    receiver.registerConsumer(CredentialsChangeNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(CredentialsChangeNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    receiver.registerConsumer(AllDevicesOfTenantDeletedNotification.TYPE, notification -> ctx.verify(() -> {
        assertThat(notification).isInstanceOf(AllDevicesOfTenantDeletedNotification.class);
        handlerInvokedCheckpoint.flag();
    }));
    receiver.start();
}
Also used : Checkpoint(io.vertx.junit5.Checkpoint) AllDevicesOfTenantDeletedNotification(org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification) Instant(java.time.Instant) CredentialsChangeNotification(org.eclipse.hono.notification.deviceregistry.CredentialsChangeNotification) DeviceChangeNotification(org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification) TenantChangeNotification(org.eclipse.hono.notification.deviceregistry.TenantChangeNotification) Test(org.junit.jupiter.api.Test)

Aggregations

DeviceChangeNotification (org.eclipse.hono.notification.deviceregistry.DeviceChangeNotification)11 Instant (java.time.Instant)8 AllDevicesOfTenantDeletedNotification (org.eclipse.hono.notification.deviceregistry.AllDevicesOfTenantDeletedNotification)8 Test (org.junit.jupiter.api.Test)8 Future (io.vertx.core.Future)7 Vertx (io.vertx.core.Vertx)7 LifecycleChange (org.eclipse.hono.notification.deviceregistry.LifecycleChange)7 Span (io.opentracing.Span)6 HttpURLConnection (java.net.HttpURLConnection)6 NotificationEventBusSupport (org.eclipse.hono.notification.NotificationEventBusSupport)6 Truth.assertThat (com.google.common.truth.Truth.assertThat)4 Tracer (io.opentracing.Tracer)4 EventBus (io.vertx.core.eventbus.EventBus)4 JsonObject (io.vertx.core.json.JsonObject)4 Cache (com.github.benmanes.caffeine.cache.Cache)3 Tags (io.opentracing.tag.Tags)3 Handler (io.vertx.core.Handler)3 Timeout (io.vertx.junit5.Timeout)3 VertxExtension (io.vertx.junit5.VertxExtension)3 VertxTestContext (io.vertx.junit5.VertxTestContext)3