use of com.synopsys.integration.alert.test.common.TestProperties in project hub-alert by blackducksoftware.
the class EmailGlobalTestActionTest method testSmtpPasswordMissingTestIT.
@Test
@Tags(value = { @Tag(TestTags.DEFAULT_INTEGRATION), @Tag(TestTags.CUSTOM_EXTERNAL_CONNECTION) })
public void testSmtpPasswordMissingTestIT() {
AuthorizationManager authorizationManager = createAuthorizationManager(AuthenticationTestUtils.FULL_PERMISSIONS);
EmailGlobalConfigurationValidator validator = new EmailGlobalConfigurationValidator();
TestProperties testProperties = new TestProperties();
String emailAddress = testProperties.getProperty(TestPropertyKey.TEST_EMAIL_RECIPIENT);
assumeTrue(testProperties.getOptionalProperty(TestPropertyKey.TEST_EMAIL_SMTP_PASSWORD).isPresent());
JavamailPropertiesFactory javamailPropertiesFactory = new JavamailPropertiesFactory();
EmailChannelMessagingService validEmailChannelMessagingService = createValidEmailChannelMessagingService(emailAddress);
EmailGlobalTestAction emailGlobalTestAction = new EmailGlobalTestAction(authorizationManager, validator, validEmailChannelMessagingService, javamailPropertiesFactory, configurationAccessor);
EmailGlobalConfigModel globalConfigModelWithoutPassword = createEmailGlobalConfigModelObfuscated(testProperties);
EmailGlobalConfigModel globalConfigModelWithPassword = createValidEmailGlobalConfigModel(testProperties);
Mockito.when(configurationAccessor.getConfiguration()).thenReturn(Optional.of(globalConfigModelWithPassword));
ConfigurationTestResult testResult = emailGlobalTestAction.testConfigModelContent(emailAddress, globalConfigModelWithoutPassword);
assertTrue(testResult.isSuccess(), "Expected the message result to not have errors");
}
use of com.synopsys.integration.alert.test.common.TestProperties in project hub-alert by blackducksoftware.
the class EmailChannelTestIT method init.
@BeforeEach
public void init() {
gson = new Gson();
testProperties = new TestProperties();
}
use of com.synopsys.integration.alert.test.common.TestProperties in project hub-alert by blackducksoftware.
the class EmailGlobalFieldModelTestActionTest method testConfigITTest.
@Test
@Tags(value = { @Tag(TestTags.DEFAULT_INTEGRATION), @Tag(TestTags.CUSTOM_EXTERNAL_CONNECTION) })
public void testConfigITTest() {
TestProperties testProperties = new TestProperties();
String emailAddress = testProperties.getProperty(TestPropertyKey.TEST_EMAIL_RECIPIENT);
FieldModel validFieldModel = createFieldModelToTest(emailAddress);
JavamailPropertiesFactory javamailPropertiesFactory = new JavamailPropertiesFactory();
EmailChannelMessagingService validEmailChannelMessagingService = createValidEmailChannelMessagingService(emailAddress);
EmailGlobalFieldModelTestAction emailGlobalFieldModelTestAction = new EmailGlobalFieldModelTestAction(validEmailChannelMessagingService, javamailPropertiesFactory);
FieldUtility validFieldUtility = createValidEmailGlobalFieldUtility(testProperties);
try {
MessageResult messageResult = emailGlobalFieldModelTestAction.testConfig("0", validFieldModel, validFieldUtility);
assertFalse(messageResult.hasErrors(), "Expected the message result to not have errors");
assertFalse(messageResult.hasWarnings(), "Expected the message result to not have warnings");
} catch (AlertException e) {
fail("An exception was thrown where none was expected", e);
}
}
use of com.synopsys.integration.alert.test.common.TestProperties in project hub-alert by blackducksoftware.
the class ScalingPerformanceTest 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);
}
use of com.synopsys.integration.alert.test.common.TestProperties in project hub-alert by blackducksoftware.
the class JmsNotificationReceiverTestIT method init.
@BeforeEach
public void init() {
properties = new TestProperties();
ConfigurationFieldModel providerConfigEnabled = ConfigurationFieldModel.create(ProviderDescriptor.KEY_PROVIDER_CONFIG_ENABLED);
providerConfigEnabled.setFieldValue("TRUE");
ConfigurationFieldModel providerConfigName = ConfigurationFieldModel.create(ProviderDescriptor.KEY_PROVIDER_CONFIG_NAME);
providerConfigName.setFieldValue("blackduck-config");
ConfigurationFieldModel blackduckUrl = ConfigurationFieldModel.create(BlackDuckDescriptor.KEY_BLACKDUCK_URL);
blackduckUrl.setFieldValue("https://www.synopsys.com");
ConfigurationFieldModel blackduckApiKey = ConfigurationFieldModel.createSensitive(BlackDuckDescriptor.KEY_BLACKDUCK_API_KEY);
blackduckApiKey.setFieldValue("someApiKey");
ConfigurationFieldModel blackduckTimeout = ConfigurationFieldModel.create(BlackDuckDescriptor.KEY_BLACKDUCK_TIMEOUT);
blackduckTimeout.setFieldValue(String.valueOf(BlackDuckProperties.DEFAULT_TIMEOUT));
ConfigurationModel blackduckConfigurationModel = defaultConfigurationAccessor.createConfiguration(blackDuckProviderKey, ConfigContextEnum.GLOBAL, List.of(providerConfigEnabled, providerConfigName, blackduckUrl, blackduckApiKey, blackduckTimeout));
blackDuckGlobalConfigId = blackduckConfigurationModel.getConfigurationId();
List<AlertNotificationModel> notificationContent = new ArrayList<>();
for (Long i = 1L; i <= 1000; i++) {
notificationContent.add(createAlertNotificationModel(i, false));
}
savedModels = defaultNotificationAccessor.saveAllNotifications(notificationContent);
SlackJobDetailsModel slackJobDetailsModel = createSlackJobDetailsModel();
DistributionJobRequestModel distributionJobRequestModel = createDistributionJobRequestModel("jobName1", slackJobDetailsModel);
distributionJobModel = staticJobAccessor.createJob(distributionJobRequestModel);
}
Aggregations