Search in sources :

Example 1 with IssueStatus

use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.

the class JiraIssueSearchResultCreator method createExistingIssueDetails.

public ExistingIssueDetails<String> createExistingIssueDetails(JiraSearcherResponseModel issue, IssueCategory issueCategory) {
    String issueCallbackLink = JiraCallbackUtils.createUILink(issue);
    IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(issue, jiraIssueTransitionRetriever::fetchIssueTransitions);
    return new ExistingIssueDetails<>(issue.getIssueId(), issue.getIssueKey(), issue.getSummaryField(), issueCallbackLink, issueStatus, issueCategory);
}
Also used : ExistingIssueDetails(com.synopsys.integration.alert.api.channel.issue.search.ExistingIssueDetails) IssueStatus(com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus)

Example 2 with IssueStatus

use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.

the class JiraIssueStatusCreatorTest method createIssueStatusExceptionTest.

@Test
public void createIssueStatusExceptionTest() {
    JiraSearcherResponseModel jiraSearcherResponseModel = new JiraSearcherResponseModel(null, "unknown", null, null);
    IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(jiraSearcherResponseModel, this::fetchIssueTransitionsException);
    assertEquals(IssueStatus.UNKNOWN, issueStatus);
}
Also used : IssueStatus(com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus) Test(org.junit.jupiter.api.Test)

Example 3 with IssueStatus

use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.

the class JiraIssueStatusCreatorTest method createIssueStatusReopenableTest.

@Test
public void createIssueStatusReopenableTest() {
    JiraSearcherResponseModel jiraSearcherResponseModel = new JiraSearcherResponseModel(null, reopenTransition, null, null);
    IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(jiraSearcherResponseModel, this::fetchIssueTransitions);
    assertEquals(IssueStatus.REOPENABLE, issueStatus);
}
Also used : IssueStatus(com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus) Test(org.junit.jupiter.api.Test)

Example 4 with IssueStatus

use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.

the class JiraIssueStatusCreatorTest method createIssueStatusUnknownTest.

@Test
public void createIssueStatusUnknownTest() {
    JiraSearcherResponseModel jiraSearcherResponseModel = new JiraSearcherResponseModel(null, "unknown", null, null);
    IssueStatus issueStatus = jiraIssueStatusCreator.createIssueStatus(jiraSearcherResponseModel, this::fetchIssueTransitions);
    assertEquals(IssueStatus.UNKNOWN, issueStatus);
}
Also used : IssueStatus(com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus) Test(org.junit.jupiter.api.Test)

Example 5 with IssueStatus

use of com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus in project hub-alert by blackducksoftware.

the class AzureBoardsExistingIssueDetailsCreator method createIssueDetails.

public ExistingIssueDetails<Integer> createIssueDetails(WorkItemResponseModel workItem, WorkItemFieldsWrapper workItemFields, ProjectIssueModel projectIssueModel) {
    Integer workItemId = workItem.getId();
    String workItemTitle = workItemFields.getField(WorkItemResponseFields.System_Title).orElse("Unknown Title");
    String workItemUILink = AzureBoardsUILinkUtils.extractUILink(organizationName, workItem);
    IssueCategory issueCategory = issueCategoryRetriever.retrieveIssueCategoryFromProjectIssueModel(projectIssueModel);
    String workItemState = workItemFields.getField(WorkItemResponseFields.System_State).orElse("Unknown");
    IssueStatus issueStatus = issueStatusResolver.resolveIssueStatus(workItemState);
    return new ExistingIssueDetails<>(workItemId, Objects.toString(workItemId), workItemTitle, workItemUILink, issueStatus, issueCategory);
}
Also used : IssueCategory(com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueCategory) ExistingIssueDetails(com.synopsys.integration.alert.api.channel.issue.search.ExistingIssueDetails) IssueStatus(com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus)

Aggregations

IssueStatus (com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueStatus)6 Test (org.junit.jupiter.api.Test)4 ExistingIssueDetails (com.synopsys.integration.alert.api.channel.issue.search.ExistingIssueDetails)2 IssueCategory (com.synopsys.integration.alert.api.channel.issue.search.enumeration.IssueCategory)1