Search in sources :

Example 6 with IntegrationPerformanceTestRunner

use of com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner 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)

Example 7 with IntegrationPerformanceTestRunner

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

the class SlackPerformanceTest method testSlackJob.

@Test
@Ignore
@Disabled
public void testSlackJob() throws Exception {
    AlertRequestUtility alertRequestUtility = IntegrationPerformanceTestRunner.createAlertRequestUtility(webApplicationContext);
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), ChannelKeys.SLACK.getUniversalKey());
    IntegrationPerformanceTestRunner integrationPerformanceTestRunner = new IntegrationPerformanceTestRunner(gson, dateTimeFormatter, alertRequestUtility, blackDuckProviderService, configurationManager);
    Map<String, FieldValueModel> slackJobFields = new HashMap<>();
    slackJobFields.put(ChannelDescriptor.KEY_ENABLED, new FieldValueModel(List.of("true"), true));
    slackJobFields.put(ChannelDescriptor.KEY_CHANNEL_NAME, new FieldValueModel(List.of(ChannelKeys.SLACK.getUniversalKey()), true));
    slackJobFields.put(ChannelDescriptor.KEY_NAME, new FieldValueModel(List.of(SLACK_PERFORMANCE_JOB_NAME), true));
    slackJobFields.put(ChannelDescriptor.KEY_FREQUENCY, new FieldValueModel(List.of(FrequencyType.REAL_TIME.name()), true));
    slackJobFields.put(ChannelDescriptor.KEY_PROVIDER_TYPE, new FieldValueModel(List.of(blackDuckProviderService.getBlackDuckProviderKey()), true));
    slackJobFields.put(SlackDescriptor.KEY_WEBHOOK, new FieldValueModel(List.of(SLACK_CHANNEL_WEBHOOK), true));
    slackJobFields.put(SlackDescriptor.KEY_CHANNEL_NAME, new FieldValueModel(List.of(SLACK_CHANNEL_NAME), true));
    slackJobFields.put(SlackDescriptor.KEY_CHANNEL_USERNAME, new FieldValueModel(List.of(SLACK_CHANNEL_USERNAME), true));
    integrationPerformanceTestRunner.runTest(slackJobFields, SLACK_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

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