From 0133e8579208dffab36b058585b7d8fc62fe0ede Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Mon, 4 Nov 2024 13:33:50 +0300 Subject: [PATCH] EPMRPP-95751 || Child item marked as "Passed" displays with 'To Investigate' defect type --- .../core/item/impl/FinishTestItemHandlerImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java b/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java index 81a92cae7f..9cfd5a8bed 100644 --- a/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java +++ b/src/main/java/com/epam/ta/reportportal/core/item/impl/FinishTestItemHandlerImpl.java @@ -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())); @@ -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);