@Test void testFailToDeleteSpace() throws FileStorageException { prepareGlobalAuditorCredentials(); prepareCfOptimizedEventsGetter(generateDeletedSpaces(1)); when(configurationEntryService.createQuery()).thenReturn(configurationEntryQuery); when(configurationSubscriptionService.createQuery()).thenReturn(configurationSubscriptionQuery); when(operationService.createQuery()).thenReturn(operationQuery); when(fileService.deleteBySpace(anyString())).thenThrow(new FileStorageException("")); Exception exception = assertThrows(SLException.class, () -> dataTerminationService.deleteOrphanUserData()); assertEquals(Messages.COULD_NOT_DELETE_SPACE_LEFTOVERS, exception.getMessage()); }
public void deleteOrphanUserData() { assertGlobalAuditorCredentialsExist(); List<String> deleteSpaceEventsToBeDeleted = getDeleteSpaceEvents(); for (String spaceId : deleteSpaceEventsToBeDeleted) { deleteConfigurationSubscriptionOrphanData(spaceId); deleteConfigurationEntryOrphanData(spaceId); deleteUserOperationsOrphanData(spaceId); deleteSpaceLeftovers(spaceId); } }
DataTerminationService { public void deleteOrphanUserData() { assertGlobalAuditorCredentialsExist(); List<String> deleteSpaceEventsToBeDeleted = getDeleteSpaceEvents(); for (String spaceId : deleteSpaceEventsToBeDeleted) { deleteConfigurationSubscriptionOrphanData(spaceId); deleteConfigurationEntryOrphanData(spaceId); deleteUserOperationsOrphanData(spaceId); deleteSpaceLeftovers(spaceId); } } }
DataTerminationService { public void deleteOrphanUserData() { assertGlobalAuditorCredentialsExist(); List<String> deleteSpaceEventsToBeDeleted = getDeleteSpaceEvents(); for (String spaceId : deleteSpaceEventsToBeDeleted) { deleteConfigurationSubscriptionOrphanData(spaceId); deleteConfigurationEntryOrphanData(spaceId); deleteUserOperationsOrphanData(spaceId); deleteSpaceLeftovers(spaceId); } }  }
DataTerminationService { public void deleteOrphanUserData() { assertGlobalAuditorCredentialsExist(); List<String> deleteSpaceEventsToBeDeleted = getDeleteSpaceEvents(); for (String spaceId : deleteSpaceEventsToBeDeleted) { deleteConfigurationSubscriptionOrphanData(spaceId); deleteConfigurationEntryOrphanData(spaceId); deleteUserOperationsOrphanData(spaceId); deleteSpaceLeftovers(spaceId); } }  void deleteOrphanUserData(); }
DataTerminationService { public void deleteOrphanUserData() { assertGlobalAuditorCredentialsExist(); List<String> deleteSpaceEventsToBeDeleted = getDeleteSpaceEvents(); for (String spaceId : deleteSpaceEventsToBeDeleted) { deleteConfigurationSubscriptionOrphanData(spaceId); deleteConfigurationEntryOrphanData(spaceId); deleteUserOperationsOrphanData(spaceId); deleteSpaceLeftovers(spaceId); } }  void deleteOrphanUserData();  }