Search in sources :

Example 1 with GlobalConfigurationValidatorAsserter

use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.

the class JiraServerGlobalConfigurationFieldModelValidatorTest method invalidUrl.

@Test
public void invalidUrl() {
    GlobalConfigurationValidatorAsserter globalConfigurationValidatorAsserter = createGlobalConfigurationValidatorAsserter();
    globalConfigurationValidatorAsserter.assertInvalidValue(JiraServerDescriptor.KEY_SERVER_URL, "not_a_url");
}
Also used : GlobalConfigurationValidatorAsserter(com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter) Test(org.junit.jupiter.api.Test)

Example 2 with GlobalConfigurationValidatorAsserter

use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.

the class BlackDuckGlobalConfigurationFieldModelValidatorTest method apiKeyTooShort.

@Test
public void apiKeyTooShort() {
    BlackDuckGlobalConfigurationFieldModelValidator blackDuckGlobalConfigurationValidator = new BlackDuckGlobalConfigurationFieldModelValidator(createDefaultConfigurationAccessor());
    GlobalConfigurationValidatorAsserter globalConfigurationValidatorAsserter = new GlobalConfigurationValidatorAsserter(new BlackDuckProviderKey().getUniversalKey(), blackDuckGlobalConfigurationValidator, createDefaultKeyToValues());
    globalConfigurationValidatorAsserter.assertInvalidValue(BlackDuckDescriptor.KEY_BLACKDUCK_API_KEY, "too short");
}
Also used : BlackDuckProviderKey(com.synopsys.integration.alert.descriptor.api.BlackDuckProviderKey) GlobalConfigurationValidatorAsserter(com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter) Test(org.junit.jupiter.api.Test)

Example 3 with GlobalConfigurationValidatorAsserter

use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.

the class AzureBoardsGlobalConfigurationFieldModelValidatorTest method missingClientKey.

@Test
public void missingClientKey() {
    GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter();
    validatorAsserter.assertMissingValue(AzureBoardsDescriptor.KEY_CLIENT_ID);
}
Also used : GlobalConfigurationValidatorAsserter(com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter) Test(org.junit.jupiter.api.Test)

Example 4 with GlobalConfigurationValidatorAsserter

use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.

the class SettingsGlobalConfigurationFieldModelValidatorTest method verifyValidConfig.

/*
     * encryption password: required, minimum encryption length
     * encryption salt: required, minimum encryption length
     *
     * proxy host: needs proxy port
     * proxy port: needs proxy host, is a number
     *
     * proxy username: needs proxy host, needs proxy password
     * proxy password: needs proxy host, needs proxy username
     */
@Test
public void verifyValidConfig() {
    GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter();
    validatorAsserter.assertValid();
}
Also used : GlobalConfigurationValidatorAsserter(com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter) Test(org.junit.jupiter.api.Test)

Example 5 with GlobalConfigurationValidatorAsserter

use of com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter in project hub-alert by blackducksoftware.

the class SettingsGlobalConfigurationFieldModelValidatorTest method passwordTooShort.

@Test
public void passwordTooShort() {
    GlobalConfigurationValidatorAsserter validatorAsserter = createValidatorAsserter();
    validatorAsserter.assertInvalidValue(SettingsDescriptor.KEY_ENCRYPTION_PWD, "short");
}
Also used : GlobalConfigurationValidatorAsserter(com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter) Test(org.junit.jupiter.api.Test)

Aggregations

GlobalConfigurationValidatorAsserter (com.synopsys.integration.alert.test.common.channel.GlobalConfigurationValidatorAsserter)32 Test (org.junit.jupiter.api.Test)31 FieldValueModel (com.synopsys.integration.alert.common.rest.model.FieldValueModel)6 BlackDuckProviderKey (com.synopsys.integration.alert.descriptor.api.BlackDuckProviderKey)4 EmailChannelKey (com.synopsys.integration.alert.descriptor.api.EmailChannelKey)2 Gson (com.google.gson.Gson)1 AlertProperties (com.synopsys.integration.alert.common.AlertProperties)1 FilePersistenceUtil (com.synopsys.integration.alert.common.persistence.util.FilePersistenceUtil)1 AuthenticationDescriptorKey (com.synopsys.integration.alert.component.authentication.descriptor.AuthenticationDescriptorKey)1 MockAlertProperties (com.synopsys.integration.alert.test.common.MockAlertProperties)1