@Override public List<EndpointNotificationDto> getUnicastNotificationsByKeyHash(byte[] keyhash) throws ControlServiceException { List<EndpointNotificationDto> structList = Collections.emptyList(); if (keyhash != null) { structList = notificationService.findUnicastNotificationsByKeyHash(keyhash); } return structList; }
notificationService.findUnicastNotificationsByKeyHash( request.getProfile().getEndpointKeyHash()); for (EndpointNotificationDto unicastNotification : unicastNotifications) {
@Test public void testRemoveUnicastNotificationsByKeyHash() { TopicDto topicDto = generateTopicDto(null, null); EndpointProfileDto profile = generateEndpointProfileDto(topicDto.getApplicationId(), Arrays.asList(topicDto.getId())); byte[] keyHash = profile.getEndpointKeyHash(); EndpointNotificationDto notification = generateUnicastNotificationDto(null, topicDto.getId(), keyHash); Assert.assertTrue(isNotBlank(notification.getId())); notificationService.removeUnicastNotificationsByKeyHash(keyHash); List<EndpointNotificationDto> notifications = notificationService.findUnicastNotificationsByKeyHash(keyHash); Assert.assertTrue(notifications.isEmpty()); }