@Override public void deleteConfigurationRecord(String schemaId, String endpointGroupId, String deactivatedUsername) throws ControlServiceException { ChangeConfigurationNotification cfgNotification = configurationService .deleteConfigurationRecord(schemaId, endpointGroupId, deactivatedUsername); if (cfgNotification != null) { ChangeNotificationDto notification = cfgNotification.getChangeNotificationDto(); if (notification != null) { notifyEndpoints(notification, null, cfgNotification.getConfigurationDto()); } } }
@Test public void deleteConfigurationRecordTest() { ConfigurationSchemaDto schemaDto = generateConfSchemaDto(null, null, 1).get(0); EndpointGroupDto group = generateEndpointGroupDto(schemaDto.getApplicationId()); generateConfigurationDto(schemaDto.getId(), group.getId(), 1, true, false); ChangeConfigurationNotification notification = configurationService.deleteConfigurationRecord(schemaDto.getId(), group.getId(), null); Assert.assertNotNull(notification); ConfigurationDto configurationDto = notification.getConfigurationDto(); Assert.assertEquals(UpdateStatus.DEPRECATED, configurationDto.getStatus()); StructureRecordDto<ConfigurationDto> records = configurationService .findConfigurationRecordBySchemaIdAndEndpointGroupId(schemaDto.getId(), group.getId()); Assert.assertNull(records.getInactiveStructureDto()); Assert.assertEquals(UpdateStatus.DEPRECATED, records.getActiveStructureDto().getStatus()); }