use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class SettingsGlobalConfigurationFieldModelValidatorTest method missingProxyPassword.
@Test
public void missingProxyPassword() {
Map<String, FieldValueModel> keyToValues = createProxyKeyToValues();
FieldValueModel username = new FieldValueModel(List.of("username"), true);
keyToValues.put(ProxyManager.KEY_PROXY_USERNAME, username);
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(keyToValues);
validatorAsserter.assertMissingValue(ProxyManager.KEY_PROXY_PWD);
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method missingLdapFields.
@Test
public void missingLdapFields() {
Map<String, FieldValueModel> keyToValues = Map.of(AuthenticationDescriptor.KEY_LDAP_ENABLED, new FieldValueModel(List.of("true"), true));
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(keyToValues);
validatorAsserter.assertCustom(alertFieldStatuses -> assertEquals(3, alertFieldStatuses.size(), alertFieldStatuses.toString()));
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method verifyInvalidLdapAndSamlEnabled.
@Test
public void verifyInvalidLdapAndSamlEnabled() {
Map<String, FieldValueModel> keyToValues = Map.of(AuthenticationDescriptor.KEY_LDAP_ENABLED, new FieldValueModel(List.of("true"), true), AuthenticationDescriptor.KEY_SAML_ENABLED, new FieldValueModel(List.of("true"), true));
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(keyToValues);
validatorAsserter.assertCustom(alertFieldStatuses -> assertTrue(alertFieldStatuses.size() >= 2, alertFieldStatuses.toString()));
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method verifyValidSamlConfiguration.
@Test
public void verifyValidSamlConfiguration() {
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(createValidSamlValues());
validatorAsserter.assertValid();
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method createValidatorAsserter.
private GlobalConfigurationValidatorAsserter createValidatorAsserter(Map<String, FieldValueModel> keyToValues) {
AlertProperties mockAlertProperties = new MockAlertProperties();
FilePersistenceUtil filePersistenceUtil = new FilePersistenceUtil(mockAlertProperties, new Gson());
return new GlobalConfigurationValidatorAsserter(new AuthenticationDescriptorKey().getUniversalKey(), new AuthenticationConfigurationFieldModelValidator(filePersistenceUtil), keyToValues);
}
Aggregations