Skip to content

Commit

Permalink
EPMRPP-95751 || Child item marked as "Passed" displays with 'To Inves…
Browse files Browse the repository at this point in the history
…tigate' defect type
  • Loading branch information
APiankouski authored Nov 4, 2024
2 parents 3190bc4 + 0133e85 commit dafb03d
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ private TestItemResults processParentItemResult(TestItem testItem,

testItemResults.setStatus(actualStatus.orElseGet(() -> resolveStatus(testItem.getItemId())));

if (Objects.nonNull(testItemResults.getIssue()) && testItemResults.getStatus().equals(PASSED)) {
removeItemIssue(testItemResults);
}

testItem.getAttributes().removeIf(
attribute -> ATTRIBUTE_KEY_STATUS.equalsIgnoreCase(attribute.getKey())
&& ATTRIBUTE_VALUE_INTERRUPTED.equalsIgnoreCase(attribute.getValue()));
Expand Down Expand Up @@ -414,6 +418,14 @@ private void deleteOldIssueIndex(StatusEnum actualStatus, TestItem testItem,
}
}

private void removeItemIssue(TestItemResults testItemResults) {
issueEntityRepository.findById(testItemResults.getItemId()).ifPresent(issueEntity -> {
issueEntity.setTestItemResults(null);
issueEntityRepository.delete(issueEntity);
testItemResults.setIssue(null);
});
}

private void updateItemIssue(TestItemResults testItemResults, IssueEntity resolvedIssue) {
issueEntityRepository.findById(testItemResults.getItemId()).ifPresent(issueEntity -> {
issueEntity.setTestItemResults(null);
Expand Down

0 comments on commit dafb03d

Please sign in to comment.