use of com.synopsys.integration.alert.api.channel.CommonChannelDistributionValidator in project hub-alert by blackducksoftware.
the class SlackDistributionConfigurationValidatorTest method testValidate.
@MethodSource("getFieldsAndExpectedErrors")
@ParameterizedTest()
public void testValidate(Map<String, FieldValueModel> fieldModelMap, Set<AlertFieldStatus> expectedValidationErrors) {
JobFieldModel testJobFieldModel = FieldModelUtils.createJobFieldModel(ValidationConstants.COMMON_CHANNEL_FIELDS, fieldModelMap);
CommonChannelDistributionValidator commonChannelDistributionValidator = new CommonChannelDistributionValidator();
SlackDistributionConfigurationValidator validator = new SlackDistributionConfigurationValidator(commonChannelDistributionValidator);
Set<AlertFieldStatus> validationErrors = validator.validate(testJobFieldModel);
Assertions.assertEquals(expectedValidationErrors, validationErrors);
}
use of com.synopsys.integration.alert.api.channel.CommonChannelDistributionValidator in project hub-alert by blackducksoftware.
the class MsTeamsDistributionConfigurationValidatorTest method testValidate.
@MethodSource("getFieldsAndExpectedErrors")
@ParameterizedTest()
public void testValidate(Map<String, FieldValueModel> fieldModelMap, Set<AlertFieldStatus> expectedValidationErrors) {
JobFieldModel testJobFieldModel = FieldModelUtils.createJobFieldModel(ValidationConstants.COMMON_CHANNEL_FIELDS, fieldModelMap);
CommonChannelDistributionValidator commonChannelDistributionValidator = new CommonChannelDistributionValidator();
MsTeamsDistributionConfigurationValidator msTeamsDistributionConfigurationValidator = new MsTeamsDistributionConfigurationValidator(commonChannelDistributionValidator);
Set<AlertFieldStatus> validationErrors = msTeamsDistributionConfigurationValidator.validate(testJobFieldModel);
Assertions.assertEquals(expectedValidationErrors, validationErrors);
}
Aggregations