use of com.synopsys.integration.alert.common.rest.model.FieldValueModel in project hub-alert by blackducksoftware.
the class EmailGlobalFieldModelTestActionTest method createFieldModelToTest.
private FieldModel createFieldModelToTest(String destinationValue) {
Map<String, FieldValueModel> keyToValues = new HashMap<>();
Set<String> values = null != destinationValue ? Set.of(destinationValue) : Set.of();
FieldValueModel destinationFieldValueModel = new FieldValueModel(values, false);
keyToValues.put(FieldModelTestAction.KEY_DESTINATION_NAME, destinationFieldValueModel);
return new FieldModel(null, null, keyToValues);
}
use of com.synopsys.integration.alert.common.rest.model.FieldValueModel 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.common.rest.model.FieldValueModel 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