use of com.synopsys.integration.alert.descriptor.api.EmailChannelKey in project hub-alert by blackducksoftware.
the class EmailGlobalConfigurationFieldModelValidatorTest method verifyValidConfig.
/*
* Email host: Required
* Email from: Required
*
* Email user: Required if email auth is true
* Email password: Required if email auth is true
*/
@Test
public void verifyValidConfig() {
GlobalConfigurationValidatorAsserter globalConfigurationValidatorAsserter = new GlobalConfigurationValidatorAsserter(new EmailChannelKey().getUniversalKey(), new EmailGlobalConfigurationFieldModelValidator(), createDefaultKeyToValues());
globalConfigurationValidatorAsserter.assertValid();
}
use of com.synopsys.integration.alert.descriptor.api.EmailChannelKey in project hub-alert by blackducksoftware.
the class StaticJobAccessorTestIT method verifyEmailSavesTest.
@Test
public void verifyEmailSavesTest() {
EmailJobDetailsModel emailJobDetailsModel = new EmailJobDetailsModel(UUID.randomUUID(), "subjectLine", false, false, "attachmentFileType", List.of());
DistributionJobRequestModel jobRequestModel = createJobRequestModel(emailJobDetailsModel, new EmailChannelKey());
createAndAssertJob(jobRequestModel);
}
use of com.synopsys.integration.alert.descriptor.api.EmailChannelKey in project hub-alert by blackducksoftware.
the class EmailGlobalConfigurationFieldModelValidatorTest method verifyMissingAuthPassword.
@Test
public void verifyMissingAuthPassword() {
Map<String, FieldValueModel> defaultKeyToValues = createDefaultKeyToValues();
FieldValueModel authFieldValueModel = new FieldValueModel(List.of("true"), true);
FieldValueModel usernameFieldValueModel = new FieldValueModel(List.of("username"), true);
defaultKeyToValues.put(EmailPropertyKeys.JAVAMAIL_AUTH_KEY.getPropertyKey(), authFieldValueModel);
defaultKeyToValues.put(EmailPropertyKeys.JAVAMAIL_USER_KEY.getPropertyKey(), usernameFieldValueModel);
GlobalConfigurationValidatorAsserter globalConfigurationValidatorAsserter = new GlobalConfigurationValidatorAsserter(new EmailChannelKey().getUniversalKey(), new EmailGlobalConfigurationFieldModelValidator(), defaultKeyToValues);
globalConfigurationValidatorAsserter.assertMissingValue(EmailPropertyKeys.JAVAMAIL_PASSWORD_KEY.getPropertyKey());
}
use of com.synopsys.integration.alert.descriptor.api.EmailChannelKey in project hub-alert by blackducksoftware.
the class EmailGlobalConfigurationFieldModelValidatorTest method verifyMissingAuth.
@Test
public void verifyMissingAuth() {
Map<String, FieldValueModel> defaultKeyToValues = createDefaultKeyToValues();
FieldValueModel authFieldValueModel = new FieldValueModel(List.of("true"), true);
defaultKeyToValues.put(EmailPropertyKeys.JAVAMAIL_AUTH_KEY.getPropertyKey(), authFieldValueModel);
FieldModel fieldModel = new FieldModel(new EmailChannelKey().getUniversalKey(), ConfigContextEnum.GLOBAL.name(), defaultKeyToValues);
EmailGlobalConfigurationFieldModelValidator emailGlobalConfigurationValidator = new EmailGlobalConfigurationFieldModelValidator();
Set<AlertFieldStatus> alertFieldStatuses = emailGlobalConfigurationValidator.validate(fieldModel);
assertEquals(2, alertFieldStatuses.size());
}
Aggregations