use of com.synopsys.integration.alert.common.channel.issuetracker.exception.IssueTrackerException in project hub-alert by blackducksoftware.
the class JiraCloudProperties method createJiraServerConfig.
public JiraCloudRestConfig createJiraServerConfig() throws IssueTrackerException {
JiraCloudRestConfigBuilder jiraServerConfigBuilder = new JiraCloudRestConfigBuilder();
jiraServerConfigBuilder.setUrl(url);
jiraServerConfigBuilder.setApiToken(accessToken);
jiraServerConfigBuilder.setAuthUserEmail(username);
jiraServerConfigBuilder.setProxyInfo(proxyInfo);
try {
return jiraServerConfigBuilder.build();
} catch (IllegalArgumentException e) {
throw new IssueTrackerException("There was an issue building the configuration: " + e.getMessage());
}
}
use of com.synopsys.integration.alert.common.channel.issuetracker.exception.IssueTrackerException in project hub-alert by blackducksoftware.
the class JiraServerProperties method createJiraServerConfig.
public JiraServerRestConfig createJiraServerConfig() throws IssueTrackerException {
JiraServerRestConfigBuilder jiraServerConfigBuilder = new JiraServerRestConfigBuilder();
jiraServerConfigBuilder.setUrl(url);
jiraServerConfigBuilder.setAuthPassword(password);
jiraServerConfigBuilder.setAuthUsername(username);
jiraServerConfigBuilder.setProxyInfo(proxyInfo);
try {
return jiraServerConfigBuilder.build();
} catch (IllegalArgumentException e) {
throw new IssueTrackerException("There was an issue building the configuration: " + e.getMessage());
}
}
use of com.synopsys.integration.alert.common.channel.issuetracker.exception.IssueTrackerException in project hub-alert by blackducksoftware.
the class JiraServerGlobalTestActionTest method testConfigIssueTrackerException.
@Test
void testConfigIssueTrackerException() throws IntegrationException {
AuthorizationManager authorizationManager = createAuthorizationManager(255);
JiraServerGlobalConfigurationValidator validator = new JiraServerGlobalConfigurationValidator();
JiraServerTestActionFactory jiraServerTestActionFactory = Mockito.mock(JiraServerTestActionFactory.class);
Mockito.when(jiraServerTestActionFactory.createTestActionWrapper(Mockito.any())).thenThrow(new IssueTrackerException("Test Exception message"));
JiraServerGlobalConfigModel jiraServerGlobalConfigModel = createValidJiraServerGlobalConfigModel();
JiraServerGlobalTestAction jiraServerGlobalTestAction = new JiraServerGlobalTestAction(authorizationManager, validator, jiraServerTestActionFactory);
ConfigurationTestResult testResult = jiraServerGlobalTestAction.testConfigModelContent(jiraServerGlobalConfigModel);
assertFalse(testResult.isSuccess());
}
use of com.synopsys.integration.alert.common.channel.issuetracker.exception.IssueTrackerException in project hub-alert by blackducksoftware.
the class JiraServerPropertiesTest method testBuildConfig.
@Test
public void testBuildConfig() {
try {
String url = "http://localhost:2990";
String password = "password";
String user = "user";
boolean pluginCheckDisabled = true;
JiraServerProperties properties = new JiraServerProperties(url, password, user, pluginCheckDisabled, ProxyInfo.NO_PROXY_INFO);
assertEquals(url, properties.getUrl());
assertEquals(password, properties.getPassword());
assertEquals(user, properties.getUsername());
assertEquals(pluginCheckDisabled, properties.isPluginCheckDisabled());
JiraServerRestConfig config = properties.createJiraServerConfig();
assertNotNull(config);
} catch (IssueTrackerException ex) {
ex.printStackTrace();
fail();
}
}
use of com.synopsys.integration.alert.common.channel.issuetracker.exception.IssueTrackerException in project hub-alert by blackducksoftware.
the class JiraServerPropertiesTest method testServerServiceFactory.
@Test
public void testServerServiceFactory() {
try {
JiraServerProperties properties = new JiraServerProperties("http://localhost:2990", "password", "user", false, ProxyInfo.NO_PROXY_INFO);
JiraServerServiceFactory serviceFactory = properties.createJiraServicesServerFactory(LoggerFactory.getLogger(getClass()), new Gson());
assertNotNull(serviceFactory);
} catch (IssueTrackerException ex) {
ex.printStackTrace();
fail();
}
}
Aggregations