Skip to content

Commit

Permalink
fix for issue with Jira Plugin (fixes #999, via #1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeleniumTestAB authored Apr 21, 2020
1 parent e0e7b80 commit b111d96
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class JiraLaunch {

private int id;
private String externalId;

private List<String> issueKeys;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class JiraTestResult {

private int id;

private Integer launchId;
private String externalId;
private List<String> issueKeys;

private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private Optional<JiraTestResult> getJiraTestResult(final JiraLaunch launch,
.setUrl(getJiraTestResultUrl(executor.getReportUrl(), testResult.getUid()))
.setStatus(testResult.getStatus().toString())
.setDate(testResult.getTime().getStop())
.setLaunchId(launch.getId());
.setExternalId(launch.getExternalId());
return Optional.of(jiraTestResult);
}
}
Expand Down Expand Up @@ -158,7 +158,7 @@ private JiraLaunch exportLaunchToJira(final JiraService jiraService, final JiraL
try {
final JiraLaunch created = jiraService.createJiraLaunch(launch);
LOGGER.info(String.format("Allure launch '%s' synced with issues '%s' successfully",
created.getId(), created.getIssueKeys()));
created.getExternalId(), created.getIssueKeys()));
return created;
} catch (Throwable e) {
LOGGER.error(String.format("Allure launch sync with issue '%s' error", launch.getIssueKeys()), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void shouldExportTestResultToJira() {
verify(service).createTestResult(argThat(result -> testResult.getName().equals(result.getName())));
verify(service).createTestResult(argThat(result -> testResult.getStatus().toString().equals(result.getStatus())));
verify(service).createTestResult(argThat(result -> result.getUrl().contains(testResult.getUid())));
verify(service).createTestResult(argThat(result -> Objects.nonNull(result.getLaunchId())));
verify(service).createTestResult(argThat(result -> Objects.nonNull(result.getExternalId())));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static JiraService mockJiraService() {
final JiraService service = mock(JiraService.class);
when(service.createJiraLaunch(any(JiraLaunch.class))).thenAnswer(i -> {
final JiraLaunch launch = i.getArgument(0);
launch.setId(RandomUtils.nextInt());
launch.setExternalId(String.valueOf(RandomUtils.nextInt()));
return launch;
});
when(service.createTestResult(any(JiraTestResult.class))).thenAnswer(i -> {
Expand Down

0 comments on commit b111d96

Please sign in to comment.