Search in sources :

Example 1 with ConfigurationManager

use of com.synopsys.integration.alert.performance.utility.ConfigurationManager in project hub-alert by blackducksoftware.

the class JiraServerPerformanceTest method createTestRunner.

private IntegrationPerformanceTestRunner createTestRunner() {
    AlertRequestUtility alertRequestUtility = IntegrationPerformanceTestRunner.createAlertRequestUtility(webApplicationContext);
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), CHANNEL_KEY.getUniversalKey());
    return new IntegrationPerformanceTestRunner(gson, dateTimeFormatter, alertRequestUtility, blackDuckProviderService, configurationManager);
}
Also used : AlertRequestUtility(com.synopsys.integration.alert.performance.utility.AlertRequestUtility) BlackDuckProviderService(com.synopsys.integration.alert.performance.utility.BlackDuckProviderService) IntegrationPerformanceTestRunner(com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner) ConfigurationManager(com.synopsys.integration.alert.performance.utility.ConfigurationManager)

Example 2 with ConfigurationManager

use of com.synopsys.integration.alert.performance.utility.ConfigurationManager in project hub-alert by blackducksoftware.

the class JiraCloudPerformanceTest method createTestRunner.

private IntegrationPerformanceTestRunner createTestRunner() {
    AlertRequestUtility alertRequestUtility = IntegrationPerformanceTestRunner.createAlertRequestUtility(webApplicationContext);
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), CHANNEL_KEY.getUniversalKey());
    return new IntegrationPerformanceTestRunner(gson, dateTimeFormatter, alertRequestUtility, blackDuckProviderService, configurationManager);
}
Also used : AlertRequestUtility(com.synopsys.integration.alert.performance.utility.AlertRequestUtility) BlackDuckProviderService(com.synopsys.integration.alert.performance.utility.BlackDuckProviderService) IntegrationPerformanceTestRunner(com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner) ConfigurationManager(com.synopsys.integration.alert.performance.utility.ConfigurationManager)

Example 3 with ConfigurationManager

use of com.synopsys.integration.alert.performance.utility.ConfigurationManager in project hub-alert by blackducksoftware.

the class EmailPerformanceTest method testEmailJob.

@Test
@Ignore
@Disabled
public void testEmailJob() throws Exception {
    AlertRequestUtility alertRequestUtility = IntegrationPerformanceTestRunner.createAlertRequestUtility(webApplicationContext);
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), EMAIL_CHANNEL_KEY);
    IntegrationPerformanceTestRunner integrationPerformanceTestRunner = new IntegrationPerformanceTestRunner(gson, dateTimeFormatter, alertRequestUtility, blackDuckProviderService, configurationManager);
    Map<String, FieldValueModel> emailGlobalConfigFields = new HashMap<>();
    emailGlobalConfigFields.put(EmailPropertyKeys.JAVAMAIL_HOST_KEY.getPropertyKey(), new FieldValueModel(List.of(EMAIL_SMTP_HOST), true));
    emailGlobalConfigFields.put(EmailPropertyKeys.JAVAMAIL_FROM_KEY.getPropertyKey(), new FieldValueModel(List.of(EMAIL_SMTP_FROM), true));
    emailGlobalConfigFields.put(FieldModelTestAction.KEY_DESTINATION_NAME, new FieldValueModel(List.of(EMAIL_RECIPIENT), true));
    FieldModel emailGlobalConfig = new FieldModel(EMAIL_CHANNEL_KEY, ConfigContextEnum.GLOBAL.name(), emailGlobalConfigFields);
    Map<String, FieldValueModel> emailJobFields = new HashMap<>();
    emailJobFields.put(ChannelDescriptor.KEY_ENABLED, new FieldValueModel(List.of("true"), true));
    emailJobFields.put(ChannelDescriptor.KEY_CHANNEL_NAME, new FieldValueModel(List.of(EMAIL_CHANNEL_KEY), true));
    emailJobFields.put(ChannelDescriptor.KEY_NAME, new FieldValueModel(List.of(EMAIL_PERFORMANCE_JOB_NAME), true));
    emailJobFields.put(ChannelDescriptor.KEY_FREQUENCY, new FieldValueModel(List.of(FrequencyType.REAL_TIME.name()), true));
    emailJobFields.put(ChannelDescriptor.KEY_PROVIDER_TYPE, new FieldValueModel(List.of(blackDuckProviderService.getBlackDuckProviderKey()), true));
    emailJobFields.put(EmailDescriptor.KEY_SUBJECT_LINE, new FieldValueModel(List.of(EMAIL_PERFORMANCE_JOB_NAME), true));
    emailJobFields.put(EmailDescriptor.KEY_EMAIL_ADDITIONAL_ADDRESSES_ONLY, new FieldValueModel(List.of("true"), true));
    emailJobFields.put(EmailDescriptor.KEY_EMAIL_ADDITIONAL_ADDRESSES, new FieldValueModel(List.of(EMAIL_RECIPIENT), true));
    integrationPerformanceTestRunner.runTest(emailGlobalConfig, emailJobFields, EMAIL_PERFORMANCE_JOB_NAME);
}
Also used : AlertRequestUtility(com.synopsys.integration.alert.performance.utility.AlertRequestUtility) BlackDuckProviderService(com.synopsys.integration.alert.performance.utility.BlackDuckProviderService) IntegrationPerformanceTestRunner(com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner) HashMap(java.util.HashMap) FieldModel(com.synopsys.integration.alert.common.rest.model.FieldModel) ConfigurationManager(com.synopsys.integration.alert.performance.utility.ConfigurationManager) FieldValueModel(com.synopsys.integration.alert.common.rest.model.FieldValueModel) Ignore(org.junit.Ignore) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Disabled(org.junit.jupiter.api.Disabled)

Example 4 with ConfigurationManager

use of com.synopsys.integration.alert.performance.utility.ConfigurationManager in project hub-alert by blackducksoftware.

the class CopyJobPerformanceTest method copyJobTest.

@Test
@Ignore
@Disabled
public void copyJobTest() throws IntegrationException {
    ExternalAlertRequestUtility alertRequestUtility = new ExternalAlertRequestUtility(intLogger, client, alertURL);
    // Create an authenticated connection to Alert
    alertRequestUtility.loginToExternalAlert();
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), ChannelKeys.SLACK.getUniversalKey());
    int count = 1000;
    String jobName = URLEncoder.encode("Jira Server", Charset.defaultCharset());
    for (int index = 1; index <= count; index++) {
        String newJobName = String.format("%s_%d", jobName, index);
        configurationManager.copyJob(jobName, newJobName);
    }
}
Also used : ExternalAlertRequestUtility(com.synopsys.integration.alert.performance.utility.ExternalAlertRequestUtility) BlackDuckProviderService(com.synopsys.integration.alert.performance.utility.BlackDuckProviderService) ConfigurationManager(com.synopsys.integration.alert.performance.utility.ConfigurationManager) Ignore(org.junit.Ignore) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Disabled(org.junit.jupiter.api.Disabled)

Example 5 with ConfigurationManager

use of com.synopsys.integration.alert.performance.utility.ConfigurationManager in project hub-alert by blackducksoftware.

the class MsTeamsPerformanceTest method testMsTeamsJob.

@Test
@Ignore
@Disabled
public void testMsTeamsJob() throws Exception {
    AlertRequestUtility alertRequestUtility = IntegrationPerformanceTestRunner.createAlertRequestUtility(webApplicationContext);
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), ChannelKeys.MS_TEAMS.getUniversalKey());
    IntegrationPerformanceTestRunner integrationPerformanceTestRunner = new IntegrationPerformanceTestRunner(gson, dateTimeFormatter, alertRequestUtility, blackDuckProviderService, configurationManager);
    Map<String, FieldValueModel> msTeamsJobFields = new HashMap<>();
    msTeamsJobFields.put(ChannelDescriptor.KEY_ENABLED, new FieldValueModel(List.of("true"), true));
    msTeamsJobFields.put(ChannelDescriptor.KEY_CHANNEL_NAME, new FieldValueModel(List.of(ChannelKeys.MS_TEAMS.getUniversalKey()), true));
    msTeamsJobFields.put(ChannelDescriptor.KEY_NAME, new FieldValueModel(List.of(MS_TEAMS_PERFORMANCE_JOB_NAME), true));
    msTeamsJobFields.put(ChannelDescriptor.KEY_FREQUENCY, new FieldValueModel(List.of(FrequencyType.REAL_TIME.name()), true));
    msTeamsJobFields.put(ChannelDescriptor.KEY_PROVIDER_TYPE, new FieldValueModel(List.of(blackDuckProviderService.getBlackDuckProviderKey()), true));
    msTeamsJobFields.put(MsTeamsDescriptor.KEY_WEBHOOK, new FieldValueModel(List.of(MSTEAMS_CHANNEL_WEBHOOK), true));
    integrationPerformanceTestRunner.runTest(msTeamsJobFields, MS_TEAMS_PERFORMANCE_JOB_NAME);
}
Also used : AlertRequestUtility(com.synopsys.integration.alert.performance.utility.AlertRequestUtility) BlackDuckProviderService(com.synopsys.integration.alert.performance.utility.BlackDuckProviderService) IntegrationPerformanceTestRunner(com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner) HashMap(java.util.HashMap) ConfigurationManager(com.synopsys.integration.alert.performance.utility.ConfigurationManager) FieldValueModel(com.synopsys.integration.alert.common.rest.model.FieldValueModel) Ignore(org.junit.Ignore) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

ConfigurationManager (com.synopsys.integration.alert.performance.utility.ConfigurationManager)8 BlackDuckProviderService (com.synopsys.integration.alert.performance.utility.BlackDuckProviderService)7 AlertRequestUtility (com.synopsys.integration.alert.performance.utility.AlertRequestUtility)5 IntegrationPerformanceTestRunner (com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner)5 Ignore (org.junit.Ignore)5 Disabled (org.junit.jupiter.api.Disabled)5 Test (org.junit.jupiter.api.Test)5 FieldValueModel (com.synopsys.integration.alert.common.rest.model.FieldValueModel)4 HashMap (java.util.HashMap)4 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)4 ExternalAlertRequestUtility (com.synopsys.integration.alert.performance.utility.ExternalAlertRequestUtility)2 FieldModel (com.synopsys.integration.alert.common.rest.model.FieldModel)1 LocalDateTime (java.time.LocalDateTime)1 ArrayList (java.util.ArrayList)1