Search in sources :

Example 1 with CustomAsynchronousJiraRestClientFactory

use of com.atlassian.jira.rest.client.internal.async.CustomAsynchronousJiraRestClientFactory in project cx-flow by checkmarx-ltd.

the class JiraTestUtils method initClient.

@PostConstruct
public void initClient() {
    if (jiraProperties != null && !ScanUtils.empty(jiraProperties.getUrl())) {
        CustomAsynchronousJiraRestClientFactory factory = new CustomAsynchronousJiraRestClientFactory();
        URI jiraURI = null;
        try {
            jiraURI = new URI(jiraProperties.getUrl());
        } catch (URISyntaxException e) {
            log.error("Error constructing URI for JIRA", e);
        }
        this.client = factory.createWithBasicHttpAuthenticationCustom(jiraURI, jiraProperties.getUsername(), jiraProperties.getToken(), jiraProperties.getHttpTimeout());
    }
}
Also used : CustomAsynchronousJiraRestClientFactory(com.atlassian.jira.rest.client.internal.async.CustomAsynchronousJiraRestClientFactory) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) PostConstruct(javax.annotation.PostConstruct)

Example 2 with CustomAsynchronousJiraRestClientFactory

use of com.atlassian.jira.rest.client.internal.async.CustomAsynchronousJiraRestClientFactory in project cx-flow by checkmarx-ltd.

the class JiraService method init.

@PostConstruct
public void init() {
    if (jiraProperties != null && !ScanUtils.empty(jiraProperties.getUrl())) {
        CustomAsynchronousJiraRestClientFactory factory = new CustomAsynchronousJiraRestClientFactory();
        try {
            this.jiraURI = new URI(jiraProperties.getUrl());
            this.client = factory.createWithBasicHttpAuthenticationCustom(jiraURI, jiraProperties.getUsername(), jiraProperties.getToken(), jiraProperties.getHttpTimeout());
            this.issueClient = this.client.getIssueClient();
            this.projectClient = this.client.getProjectClient();
            this.metaClient = this.client.getMetadataClient();
            configJira();
        } catch (URISyntaxException | RestClientException e) {
            log.error("Error constructing URI for JIRA: {}", e.getMessage());
        }
    }
}
Also used : CustomAsynchronousJiraRestClientFactory(com.atlassian.jira.rest.client.internal.async.CustomAsynchronousJiraRestClientFactory) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) PostConstruct(javax.annotation.PostConstruct)

Aggregations

CustomAsynchronousJiraRestClientFactory (com.atlassian.jira.rest.client.internal.async.CustomAsynchronousJiraRestClientFactory)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 PostConstruct (javax.annotation.PostConstruct)2