use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AzureBoardsGlobalConfigurationFieldModelValidatorTest method missingOrganizationName.
@Test
public void missingOrganizationName() {
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter();
validatorAsserter.assertMissingValue(AzureBoardsDescriptor.KEY_ORGANIZATION_NAME);
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class AzureBoardsGlobalConfigurationFieldModelValidatorTest method verifyValidConfig.
/*
* organizationName: required
* client key: required
* client secret: required
* oauthRequestValidator: can't be running when validating
*/
@Test
public void verifyValidConfig() {
GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter();
validatorAsserter.assertValid();
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter 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.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class BlackDuckGlobalConfigurationFieldModelValidatorTest method invalidUrl.
@Test
public void invalidUrl() {
BlackDuckGlobalConfigurationFieldModelValidator blackDuckGlobalConfigurationValidator = new BlackDuckGlobalConfigurationFieldModelValidator(createDefaultConfigurationAccessor());
GlobalConfigurationValidatorAsserter globalConfigurationValidatorAsserter = new GlobalConfigurationValidatorAsserter(new BlackDuckProviderKey().getUniversalKey(), blackDuckGlobalConfigurationValidator, createDefaultKeyToValues());
globalConfigurationValidatorAsserter.assertInvalidValue(BlackDuckDescriptor.KEY_BLACKDUCK_URL, "badUrl");
}
use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.
the class BlackDuckGlobalConfigurationFieldModelValidatorTest method givesTimeoutError.
@Test
public void givesTimeoutError() {
BlackDuckGlobalConfigurationFieldModelValidator blackDuckGlobalConfigurationValidator = new BlackDuckGlobalConfigurationFieldModelValidator(createDefaultConfigurationAccessor());
GlobalConfigurationValidatorAsserter globalConfigurationValidatorAsserter = new GlobalConfigurationValidatorAsserter(new BlackDuckProviderKey().getUniversalKey(), blackDuckGlobalConfigurationValidator, createDefaultKeyToValues());
globalConfigurationValidatorAsserter.assertInvalidValue(BlackDuckDescriptor.KEY_BLACKDUCK_TIMEOUT, "0", (fieldStatus) -> assertEquals(FieldStatusSeverity.ERROR, fieldStatus.getSeverity()));
}
Aggregations