Search in sources :

Example 1 with SettingsSystemValidator

use of com.synopsys.integration.alert.component.settings.validator.SettingsSystemValidator in project hub-alert by blackducksoftware.

the class SystemValidatorTest method testValidate.

@Test
public void testValidate() {
    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.validate();
}
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)

Example 2 with SettingsSystemValidator

use of com.synopsys.integration.alert.component.settings.validator.SettingsSystemValidator 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)2 SystemMessageAccessor (com.synopsys.integration.alert.common.persistence.accessor.SystemMessageAccessor)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 BlackDuckProperties (com.synopsys.integration.alert.provider.blackduck.BlackDuckProperties)2 Test (org.junit.jupiter.api.Test)2