use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method deleteDescriptorFoundTest.
@Test
void deleteDescriptorFoundTest() {
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.GLOBAL, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.deleteDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertTrue(saveActions.wasDeleteCalled());
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method createdDescriptorFoundTest.
@Test
void createdDescriptorFoundTest() {
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.GLOBAL, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.createDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertTrue(saveActions.wasCreatedCalled());
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class EmailConfigActionTestIT method createConversionService.
private GlobalConfigurationModelToConcreteConversionService createConversionService(EmailGlobalCrudActions emailGlobalCrudActions) {
EmailGlobalConfigurationModelConverter modelConverter = new EmailGlobalConfigurationModelConverter();
EmailGlobalConfigurationModelSaveActions emailGlobalConfigurationModelSaveActions = new EmailGlobalConfigurationModelSaveActions(modelConverter, emailGlobalCrudActions, emailGlobalConfigAccessor);
List<GlobalConfigurationModelToConcreteSaveActions> conversionActions = List.of(emailGlobalConfigurationModelSaveActions);
return new GlobalConfigurationModelToConcreteConversionService(conversionActions, descriptorMap);
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method updatedDescriptorFoundTest.
@Test
void updatedDescriptorFoundTest() {
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.GLOBAL, Map.of());
GlobalConfigurationModelToConcreteConversionService conversionService = new GlobalConfigurationModelToConcreteConversionService(fieldModelSaveActions, descriptorMap);
conversionService.updateDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertTrue(saveActions.wasUpdateCalled());
}
use of com.synopsys.integration.alert.common.action.api.GlobalConfigurationModelToConcreteSaveActions in project hub-alert by blackducksoftware.
the class GlobalConfigurationModelToConcreteConversionServiceTest method updatedDescriptorMissingTest.
@Test
void updatedDescriptorMissingTest() {
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.updateDefaultConcreteModel(TEST_DESCRIPTOR_KEY, configurationModel);
assertFalse(saveActions.wasUpdateCalled());
}
Aggregations