Search in sources :

Example 6 with SystemMessageAccessor

use of com.synopsys.integration.alert.common.persistence.accessor.SystemMessageAccessor in project hub-alert by blackducksoftware.

the class SystemValidatorTest method testValidateProviders.

@Test
public void testValidateProviders() throws IOException {
    BlackDuckProperties blackDuckProperties = Mockito.mock(BlackDuckProperties.class);
    Mockito.when(blackDuckProperties.getBlackDuckUrl()).thenReturn(Optional.of("Black Duck URL"));
    Mockito.when(blackDuckProperties.getApiToken()).thenReturn("Black Duck API Token");
    Mockito.when(blackDuckProperties.getBlackDuckTimeout()).thenReturn(BlackDuckProperties.DEFAULT_TIMEOUT);
    SettingsSystemValidator settingsSystemValidator = Mockito.mock(SettingsSystemValidator.class);
    ConfigurationModelConfigurationAccessor configurationModelConfigurationAccessor = Mockito.mock(ConfigurationModelConfigurationAccessor.class);
    UserSystemValidator userSystemValidator = Mockito.mock(UserSystemValidator.class);
    SystemMessageAccessor systemMessageAccessor = Mockito.mock(SystemMessageAccessor.class);
    SystemMessageInitializer systemValidator = new SystemMessageInitializer(List.of(), settingsSystemValidator, configurationModelConfigurationAccessor, userSystemValidator, systemMessageAccessor);
    systemValidator.validateProviders();
    assertTrue(outputLogger.isLineContainingText("Validating configured providers: "));
}
Also used : BlackDuckProperties(com.synopsys.integration.alert.provider.blackduck.BlackDuckProperties) SettingsSystemValidator(com.synopsys.integration.alert.component.settings.validator.SettingsSystemValidator) UserSystemValidator(com.synopsys.integration.alert.component.users.UserSystemValidator) ConfigurationModelConfigurationAccessor(com.synopsys.integration.alert.common.persistence.accessor.ConfigurationModelConfigurationAccessor) SystemMessageAccessor(com.synopsys.integration.alert.common.persistence.accessor.SystemMessageAccessor) DefaultSystemMessageAccessor(com.synopsys.integration.alert.database.system.DefaultSystemMessageAccessor) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurationModelConfigurationAccessor (com.synopsys.integration.alert.common.persistence.accessor.ConfigurationModelConfigurationAccessor)6 SystemMessageAccessor (com.synopsys.integration.alert.common.persistence.accessor.SystemMessageAccessor)6 Test (org.junit.jupiter.api.Test)6 SystemMessageSeverity (com.synopsys.integration.alert.common.enumeration.SystemMessageSeverity)4 ConfigContextEnum (com.synopsys.integration.alert.common.enumeration.ConfigContextEnum)2 ConfigurationModel (com.synopsys.integration.alert.common.persistence.model.ConfigurationModel)2 SettingsSystemValidator (com.synopsys.integration.alert.component.settings.validator.SettingsSystemValidator)2 UserSystemValidator (com.synopsys.integration.alert.component.users.UserSystemValidator)2 DefaultSystemMessageAccessor (com.synopsys.integration.alert.database.system.DefaultSystemMessageAccessor)2 ProviderKey (com.synopsys.integration.alert.descriptor.api.model.ProviderKey)2 BlackDuckProperties (com.synopsys.integration.alert.provider.blackduck.BlackDuckProperties)2 SystemMessageType (com.synopsys.integration.alert.common.enumeration.SystemMessageType)1