Skip to content

Commit

Permalink
fix(jira): Check test plan only when the campaign is linked with jira…
Browse files Browse the repository at this point in the history
… issue (#218)
  • Loading branch information
DelaunayAlex authored Nov 7, 2024
1 parent 8f141fc commit d3db2ec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ public String createTestExecution(String testPlanId) {

@Override
public boolean isTestPlan(String issueId) {
if (issueId.isEmpty()) {
return false;
}
return getIssue(issueId).getIssueType().getId().equals(getIssueTypeByName("Test Plan").getId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,28 @@ void test_issue_as_test_plan() {
.hasMessage("Unable to get issue [PRJ-666] : ")
.hasRootCauseExactlyInstanceOf(UnknownHostException.class);
}

@Test
void test_empty_issue_as_test_plan() {
// Given
String issueId = "";

var config = new JiraServerConfiguration(
"http://fake-server-jira",
"user",
"password",
null,
"",
""
);
var sut = new HttpJiraXrayImpl(config);

// When
boolean result = sut.isTestPlan(issueId);

// Then
assertThat(result).isFalse();
}
}

@Nested
Expand Down

0 comments on commit d3db2ec

Please sign in to comment.