use of com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory in project syndesis-qe by syndesisio.
the class JiraClientFactory method getJiraRestClient.
@Bean
public JiraRestClient getJiraRestClient() throws URISyntaxException {
Account jiraAccount = AccountsDirectory.getInstance().get("Jira");
String jiraUrl = jiraAccount.getProperty("jiraurl");
return new AsynchronousJiraRestClientFactory().create(new URI(jiraUrl), new OAuthJiraAuthenticationHandler());
}
use of com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory in project mirrorgate-jira-stories-collector by BBVA.
the class Config method getJiraRestClient.
@Bean
public synchronized JiraRestClient getJiraRestClient() {
if (restClientInstance == null) {
URI jiraServerUri = null;
try {
jiraServerUri = new URI(jiraUrl);
} catch (URISyntaxException e) {
e.printStackTrace();
}
restClientInstance = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication(jiraServerUri, jiraUserName, jiraPassword);
}
return restClientInstance;
}
use of com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory in project syndesis-qe by syndesisio.
the class IssueHooksUtils method getJiraClient.
private static JiraRestClient getJiraClient(Scenario scenario) {
String userName = "";
String password = "";
String instanceUrl = "";
URI uri = null;
Optional<Account> account = AccountsDirectory.getInstance().getAccount(Account.Name.JIRA_HOOK);
if (account.isPresent()) {
if (!account.get().getProperties().keySet().containsAll(Arrays.asList("username", "password", "instanceUrl"))) {
logError(scenario, "Account with name \"Jira\" and properties \"username\", \"password\", \"instanceUrl\" is required in credentials.json file.");
logError(scenario, "If you want to get known issues from Jira in logs in case of scenario fails, update your credentials.");
return null;
} else {
userName = account.get().getProperty("username");
password = account.get().getProperty("password");
instanceUrl = account.get().getProperty("instanceUrl");
}
}
JiraRestClientFactory factory = new AsynchronousJiraRestClientFactory();
try {
uri = new URI(instanceUrl);
} catch (URISyntaxException e) {
log.error("URL {} is a malformed URL", instanceUrl);
e.printStackTrace();
}
return factory.createWithBasicHttpAuthentication(uri, userName, password);
}
Aggregations