use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method deletedDescriptorFoundNotGlobalTest.
@Test
void deletedDescriptorFoundNotGlobalTest() {
TestSaveActions saveActions = new TestSaveActions(testDescriptorKey);
DescriptorMap descriptorMap = new DescriptorMap(List.of(testDescriptorKey), List.of());
List<GlobalConfigurationModelToConcreteSaveActions> fieldModelSaveActions = List.of(saveActions);
String timestamp = DateUtils.createCurrentDateString(DateUtils.UTC_DATE_FORMAT_TO_MINUTE);
ConfigurationModel configurationModel = new ConfigurationModel(1L, 1L, timestamp, timestamp, ConfigContextEnum.DISTRIBUTION, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.deleteDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertFalse(saveActions.wasDeleteCalled());
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method createdDescriptorFoundNotGlobalTest.
@Test
void createdDescriptorFoundNotGlobalTest() {
TestSaveActions saveActions = new TestSaveActions(testDescriptorKey);
DescriptorMap descriptorMap = new DescriptorMap(List.of(testDescriptorKey), List.of());
List<GlobalConfigurationModelToConcreteSaveActions> fieldModelSaveActions = List.of(saveActions);
String timestamp = DateUtils.createCurrentDateString(DateUtils.UTC_DATE_FORMAT_TO_MINUTE);
ConfigurationModel configurationModel = new ConfigurationModel(1L, 1L, timestamp, timestamp, ConfigContextEnum.DISTRIBUTION, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.createDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertFalse(saveActions.wasCreatedCalled());
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method createdDescriptorMissingTest.
@Test
void createdDescriptorMissingTest() {
TestSaveActions saveActions = new TestSaveActions(testDescriptorKey);
DescriptorMap descriptorMap = new DescriptorMap(List.of(), List.of());
List<GlobalConfigurationModelToConcreteSaveActions> fieldModelSaveActions = List.of(saveActions);
String timestamp = DateUtils.createCurrentDateString(DateUtils.UTC_DATE_FORMAT_TO_MINUTE);
ConfigurationModel configurationModel = new ConfigurationModel(1L, 1L, timestamp, timestamp, ConfigContextEnum.GLOBAL, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.createDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertFalse(saveActions.wasCreatedCalled());
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method updateDescriptorFoundNotGlobalTest.
@Test
void updateDescriptorFoundNotGlobalTest() {
TestSaveActions saveActions = new TestSaveActions(testDescriptorKey);
DescriptorMap descriptorMap = new DescriptorMap(List.of(testDescriptorKey), List.of());
List<GlobalConfigurationModelToConcreteSaveActions> fieldModelSaveActions = List.of(saveActions);
String timestamp = DateUtils.createCurrentDateString(DateUtils.UTC_DATE_FORMAT_TO_MINUTE);
ConfigurationModel configurationModel = new ConfigurationModel(1L, 1L, timestamp, timestamp, ConfigContextEnum.DISTRIBUTION, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.updateDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertFalse(saveActions.wasUpdateCalled());
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method deletedDescriptorMissingTest.
@Test
void deletedDescriptorMissingTest() {
TestSaveActions saveActions = new TestSaveActions(testDescriptorKey);
DescriptorMap descriptorMap = new DescriptorMap(List.of(), List.of());
List<GlobalConfigurationModelToConcreteSaveActions> fieldModelSaveActions = List.of(saveActions);
String timestamp = DateUtils.createCurrentDateString(DateUtils.UTC_DATE_FORMAT_TO_MINUTE);
ConfigurationModel configurationModel = new ConfigurationModel(1L, 1L, timestamp, timestamp, ConfigContextEnum.GLOBAL, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.deleteDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertFalse(saveActions.wasDeleteCalled());
}
Aggregations