Skip to content

Commit d3db2ec

Browse files
authored
fix(jira): Check test plan only when the campaign is linked with jira issue (#218)
1 parent 8f141fc commit d3db2ec

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

chutney/jira/src/main/java/com/chutneytesting/jira/infra/HttpJiraXrayImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ public String createTestExecution(String testPlanId) {
171171

172172
@Override
173173
public boolean isTestPlan(String issueId) {
174+
if (issueId.isEmpty()) {
175+
return false;
176+
}
174177
return getIssue(issueId).getIssueType().getId().equals(getIssueTypeByName("Test Plan").getId());
175178
}
176179

chutney/jira/src/test/java/com/chutneytesting/jira/infra/HttpJiraXrayImplTest.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,28 @@ void test_issue_as_test_plan() {
9090
.hasMessage("Unable to get issue [PRJ-666] : ")
9191
.hasRootCauseExactlyInstanceOf(UnknownHostException.class);
9292
}
93+
94+
@Test
95+
void test_empty_issue_as_test_plan() {
96+
// Given
97+
String issueId = "";
98+
99+
var config = new JiraServerConfiguration(
100+
"http://fake-server-jira",
101+
"user",
102+
"password",
103+
null,
104+
"",
105+
""
106+
);
107+
var sut = new HttpJiraXrayImpl(config);
108+
109+
// When
110+
boolean result = sut.isTestPlan(issueId);
111+
112+
// Then
113+
assertThat(result).isFalse();
114+
}
93115
}
94116

95117
@Nested

0 commit comments

Comments
 (0)