private async Task UpdateClusterInformation(
     PerformContext context,
     int runId,
     List <Notification> savedNotifications)
 {
     try
     {
         await _clusterImportService.UpdateClusterInformation(savedNotifications);
     }
     catch (Exception e)
     {
         Log.Error(e, e.Message);
         await _logger.LogGroupWarning(context, runId, savedNotifications,
                                       "An error occurred while attempting to update the cluster information for the group." +
                                       " Please contact your system administrator to fix this issue.");
     }
 }
Esempio n. 2
0
        public async Task NotificationImport_SetsCluster_WhenItExists()
        {
            // Arrange
            const string clusterId    = "ABC123";
            const int    etsId        = 11;
            var          notification = new Notification {
                NotificationId = 400, ETSID = etsId.ToString()
            };

            SetupClusterIdForEtsId(etsId, clusterId);

            // Act
            var notifications = new List <Notification> {
                notification
            };
            await _clusterImportService.UpdateClusterInformation(notifications);

            // Assert
            Assert.Equal(clusterId, notification.ClusterId);
            _notificationRepository.Verify(nr => nr.SaveChangesAsync(NotificationAuditType.SystemEdited, AuditService.AuditUserSystem), Times.Once);
        }