use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class BlackDuckGlobalConfigurationFieldModelValidatorTest method givesTimeoutWarning.
@Test
public void givesTimeoutWarning() {
BlackDuckGlobalConfigurationFieldModelValidator blackDuckGlobalConfigurationValidator = new BlackDuckGlobalConfigurationFieldModelValidator(createDefaultConfigurationAccessor());
GlobalConfigurationValidatorAsserter globalConfigurationValidatorAsserter = new GlobalConfigurationValidatorAsserter(new BlackDuckProviderKey().getUniversalKey(), blackDuckGlobalConfigurationValidator, createDefaultKeyToValues());
globalConfigurationValidatorAsserter.assertInvalidValue(BlackDuckDescriptor.KEY_BLACKDUCK_TIMEOUT, "500", (fieldStatus) -> assertEquals(FieldStatusSeverity.WARNING, fieldStatus.getSeverity()));
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class SettingsGlobalConfigurationFieldModelValidatorTest method saltTooShort.
@Test
public void saltTooShort() {
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter();
validatorAsserter.assertInvalidValue(SettingsDescriptor.KEY_ENCRYPTION_GLOBAL_SALT, "short");
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class SettingsGlobalConfigurationFieldModelValidatorTest method validHostAndPort.
@Test
public void validHostAndPort() {
Map<String, FieldValueModel> keyToValues = createProxyKeyToValues();
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(keyToValues);
validatorAsserter.assertValid();
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method missingSamlFields.
@Test
public void missingSamlFields() {
Map<String, FieldValueModel> keyToValues = Map.of(AuthenticationDescriptor.KEY_SAML_ENABLED, new FieldValueModel(List.of("true"), true));
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(keyToValues);
validatorAsserter.assertCustom(alertFieldStatuses -> assertEquals(5, alertFieldStatuses.size(), alertFieldStatuses.toString()));
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AuthenticationConfigurationValidatorTest method verifyValidConfiguration.
/*
* LDAP Enabled: Not allowed with SAML Enabled
* LDAP Server: required with LDAP Enabled
* LDAP Manager Dn: required with LDAP Enabled
* LDAP Manager Password: required with LDAP Enabled
*
* LDAP authentication type: has option
* LDAP referral: has option
*/
/*
* SAML Enabled: Not allowed with LDAP Enabled
* SAML force auth: required with SAML Enabled
* SAML Entity ID: required with SAML Enabled
* SAML Entity base url: required with SAML Enabled, required without SAML metadata file
* SAML Metadata url: required without SAML metadata file
* SAML metadata file: required without SAML metadata url
*/
@Test
public void verifyValidConfiguration() {
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter(Map.of());
validatorAsserter.assertValid();
}
Aggregations