diff --git a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/ProcessNotification.java b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/ProcessNotification.java index 5aed003ad860c86bba4ae5641e018640b8ec139d..641d9f574812456292054824b3a873e84d9a64e9 100644 --- a/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/ProcessNotification.java +++ b/provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/ProcessNotification.java @@ -81,13 +81,8 @@ public class ProcessNotification { requestTelemetry.setId(message.getMessageId()); if (!response.isSuccessCode()) { - telemetryClient.trackRequest(requestTelemetry); - if(message.getDeliveryCount()>8){ - LOGGER.info("Message delivery status is 'Abandon' with notificationId: {}, Count: {}", notificationContent.getNotificationId(), message.getDeliveryCount()); - } else { - LOGGER.error(NOT_ACKNOWLEDGE); - throw new Exception(NOT_ACKNOWLEDGE); - } + telemetryClient.trackRequest(requestTelemetry); + LOGGER.error(NOT_ACKNOWLEDGE); }else{ requestTelemetry.setResponseCode("200"); requestTelemetry.setSuccess(true); diff --git a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/messageBus/ProcessNotificationTest.java b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/messageBus/ProcessNotificationTest.java index 789d76697846e64a8bd3b334b258903cc2ed8378..3cb29838555482a6f10ac300c071a751e3ddc4d4 100644 --- a/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/messageBus/ProcessNotificationTest.java +++ b/provider/notification-azure/src/test/java/org/opengroup/osdu/notification/messageBus/ProcessNotificationTest.java @@ -93,14 +93,9 @@ public class ProcessNotificationTest { response.setResponseCode(400); when(requestBodyAdapter.extractNotificationContent(message, subscriptionName)).thenReturn(notificationContent); when(notificationHandler.notifySubscriber(notificationId, notificationData, requestAttributes)).thenReturn(response); - try { - processNotification.performNotification(message, subscriptionName); - fail(EXCEPTION_NOT_THROWN); - } catch (Exception e) { - verify(notificationHandler, times(1)).notifySubscriber(notificationId, notificationData, requestAttributes); - verify(requestBodyAdapter, times(1)).extractNotificationContent(message, subscriptionName); - Assert.assertEquals(NOT_ACKNOWLEDGE, e.getMessage()); - } + processNotification.performNotification(message, subscriptionName); + verify(notificationHandler, times(1)).notifySubscriber(notificationId, notificationData, requestAttributes); + verify(requestBodyAdapter, times(1)).extractNotificationContent(message, subscriptionName); } @Test