Search in sources :

Example 1 with TestProperties

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

the class SlackPerformanceTest method initTest.

@BeforeAll
public static void initTest() {
    TestProperties testProperties = new TestProperties();
    SLACK_CHANNEL_WEBHOOK = testProperties.getProperty(TestPropertyKey.TEST_SLACK_WEBHOOK);
    SLACK_CHANNEL_NAME = testProperties.getProperty(TestPropertyKey.TEST_SLACK_CHANNEL_NAME);
    SLACK_CHANNEL_USERNAME = testProperties.getProperty(TestPropertyKey.TEST_SLACK_USERNAME);
}
Also used : TestProperties(com.synopsys.integration.alert.test.common.TestProperties) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with TestProperties

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

the class JiraServerPerformanceTest method jiraServerJobTest.

@Test
@Disabled
public void jiraServerJobTest() throws Exception {
    TestProperties testProperties = new TestProperties();
    FieldModel globalConfig = createGlobalConfig(testProperties);
    // Install plugin
    ActionResponse<String> actionResponse = jiraServerCustomFunctionAction.createActionResponse(globalConfig, null);
    if (actionResponse.isError()) {
        fail("Unable to install the Alert plugin for Jira Server. Exiting test...");
    }
    Map<String, FieldValueModel> channelFieldsMap = createChannelFieldsMap(testProperties);
    IntegrationPerformanceTestRunner testRunner = createTestRunner();
    testRunner.runTest(globalConfig, channelFieldsMap, PERFORMANCE_JOB_NAME);
}
Also used : TestProperties(com.synopsys.integration.alert.test.common.TestProperties) IntegrationPerformanceTestRunner(com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner) FieldModel(com.synopsys.integration.alert.common.rest.model.FieldModel) FieldValueModel(com.synopsys.integration.alert.common.rest.model.FieldValueModel) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Disabled(org.junit.jupiter.api.Disabled)

Example 3 with TestProperties

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

the class JiraServerSummaryFieldLengthTestIT method createJiraServerMessageSender.

private static IssueTrackerMessageSender<String> createJiraServerMessageSender() throws AlertException {
    TestProperties testProperties = new TestProperties();
    Gson gson = new GsonBuilder().create();
    IssueCategoryRetriever issueCategoryRetriever = new IssueCategoryRetriever();
    JiraServerMessageSenderFactory jiraServerMessageSenderFactory = new JiraServerMessageSenderFactory(gson, ChannelKeys.JIRA_SERVER, createJiraServerPropertiesFactory(testProperties), new IssueTrackerCallbackInfoCreator(), issueCategoryRetriever);
    JiraServerJobDetailsModel jiraServerJobDetails = createJiraServerJobDetails(testProperties);
    return jiraServerMessageSenderFactory.createMessageSender(jiraServerJobDetails);
}
Also used : TestProperties(com.synopsys.integration.alert.test.common.TestProperties) IssueTrackerCallbackInfoCreator(com.synopsys.integration.alert.api.channel.issue.callback.IssueTrackerCallbackInfoCreator) GsonBuilder(com.google.gson.GsonBuilder) JiraServerMessageSenderFactory(com.synopsys.integration.alert.channel.jira.server.distribution.JiraServerMessageSenderFactory) Gson(com.google.gson.Gson) JiraServerJobDetailsModel(com.synopsys.integration.alert.common.persistence.model.job.details.JiraServerJobDetailsModel) IssueCategoryRetriever(com.synopsys.integration.alert.api.channel.issue.search.IssueCategoryRetriever)

Example 4 with TestProperties

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

the class MsTeamsChannelTest method init.

@BeforeEach
public void init() {
    gson = new Gson();
    properties = new TestProperties();
}
Also used : TestProperties(com.synopsys.integration.alert.test.common.TestProperties) Gson(com.google.gson.Gson) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with TestProperties

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

the class EmailGlobalTestActionTest method testPermissionConfigITTest.

@Test
@Tags(value = { @Tag(TestTags.DEFAULT_INTEGRATION), @Tag(TestTags.CUSTOM_EXTERNAL_CONNECTION) })
public void testPermissionConfigITTest() {
    AuthorizationManager authorizationManager = createAuthorizationManager(AuthenticationTestUtils.FULL_PERMISSIONS);
    EmailGlobalConfigurationValidator validator = new EmailGlobalConfigurationValidator();
    TestProperties testProperties = new TestProperties();
    String emailAddress = testProperties.getProperty(TestPropertyKey.TEST_EMAIL_RECIPIENT);
    JavamailPropertiesFactory javamailPropertiesFactory = new JavamailPropertiesFactory();
    EmailChannelMessagingService validEmailChannelMessagingService = createValidEmailChannelMessagingService(emailAddress);
    EmailGlobalTestAction emailGlobalTestAction = new EmailGlobalTestAction(authorizationManager, validator, validEmailChannelMessagingService, javamailPropertiesFactory, configurationAccessor);
    EmailGlobalConfigModel globalConfigModel = createValidEmailGlobalConfigModel(testProperties);
    ActionResponse<ValidationResponseModel> response = emailGlobalTestAction.testWithPermissionCheck(emailAddress, globalConfigModel);
    assertEquals(HttpStatus.OK, response.getHttpStatus());
    assertTrue(response.hasContent());
    assertFalse(response.getContent().get().hasErrors(), "Expected the message result to not have errors");
}
Also used : TestProperties(com.synopsys.integration.alert.test.common.TestProperties) EmailGlobalConfigModel(com.synopsys.integration.alert.service.email.model.EmailGlobalConfigModel) ValidationResponseModel(com.synopsys.integration.alert.common.rest.model.ValidationResponseModel) EmailGlobalConfigurationValidator(com.synopsys.integration.alert.channel.email.validator.EmailGlobalConfigurationValidator) AuthorizationManager(com.synopsys.integration.alert.common.security.authorization.AuthorizationManager) JavamailPropertiesFactory(com.synopsys.integration.alert.service.email.JavamailPropertiesFactory) EmailChannelMessagingService(com.synopsys.integration.alert.channel.email.distribution.EmailChannelMessagingService) Test(org.junit.jupiter.api.Test) TestTags(com.synopsys.integration.alert.test.common.TestTags) Tags(org.junit.jupiter.api.Tags)

Aggregations

TestProperties (com.synopsys.integration.alert.test.common.TestProperties)24 Test (org.junit.jupiter.api.Test)10 Gson (com.google.gson.Gson)6 EmailChannelMessagingService (com.synopsys.integration.alert.channel.email.distribution.EmailChannelMessagingService)5 JavamailPropertiesFactory (com.synopsys.integration.alert.service.email.JavamailPropertiesFactory)5 BeforeAll (org.junit.jupiter.api.BeforeAll)5 BeforeEach (org.junit.jupiter.api.BeforeEach)5 EmailGlobalConfigurationValidator (com.synopsys.integration.alert.channel.email.validator.EmailGlobalConfigurationValidator)4 ConfigurationFieldModel (com.synopsys.integration.alert.common.persistence.model.ConfigurationFieldModel)4 AuthorizationManager (com.synopsys.integration.alert.common.security.authorization.AuthorizationManager)4 EmailGlobalConfigModel (com.synopsys.integration.alert.service.email.model.EmailGlobalConfigModel)4 TestTags (com.synopsys.integration.alert.test.common.TestTags)4 Tags (org.junit.jupiter.api.Tags)4 ConfigurationModel (com.synopsys.integration.alert.common.persistence.model.ConfigurationModel)3 FieldModel (com.synopsys.integration.alert.common.rest.model.FieldModel)3 GsonBuilder (com.google.gson.GsonBuilder)2 IssueTrackerCallbackInfoCreator (com.synopsys.integration.alert.api.channel.issue.callback.IssueTrackerCallbackInfoCreator)2 IssueCategoryRetriever (com.synopsys.integration.alert.api.channel.issue.search.IssueCategoryRetriever)2 ConfigurationTestResult (com.synopsys.integration.alert.common.message.model.ConfigurationTestResult)2 MessageResult (com.synopsys.integration.alert.common.message.model.MessageResult)2