Skip to content

Commit 5ca7050

Browse files
committed
Fix the bug with the publishing of tags changed event in HoA in PUT test case
1 parent 82aeae7 commit 5ca7050

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/java/com/epam/reportportal/base/core/tms/mapper/processor/TmsTmsTestCaseFieldProcessorImpl.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@
2222
import com.epam.reportportal.base.infrastructure.persistence.entity.activity.EventAction;
2323
import com.epam.reportportal.base.model.activity.TestCaseActivityResource;
2424

25+
import java.util.Collection;
2526
import java.util.Objects;
2627
import java.util.Optional;
2728
import java.util.function.Function;
29+
import org.apache.commons.collections4.CollectionUtils;
2830

2931
public class TmsTmsTestCaseFieldProcessorImpl implements TmsTestCaseFieldProcessor {
3032

@@ -52,7 +54,7 @@ public Optional<TestCaseFieldChangedEvent> process(TestCaseActivityResource befo
5254
Object beforeValue = valueExtractor.apply(before);
5355
Object afterValue = valueExtractor.apply(after);
5456

55-
if (Objects.equals(beforeValue, afterValue)) {
57+
if (areValuesEqual(beforeValue, afterValue)) {
5658
return Optional.empty();
5759
}
5860

@@ -100,4 +102,11 @@ private boolean isValueEmpty(Object value) {
100102
}
101103
return false;
102104
}
105+
106+
private boolean areValuesEqual(Object beforeValue, Object afterValue) {
107+
if (beforeValue instanceof Collection && afterValue instanceof Collection) {
108+
return CollectionUtils.isEqualCollection((Collection<?>) beforeValue, (Collection<?>) afterValue);
109+
}
110+
return Objects.equals(beforeValue, afterValue);
111+
}
103112
}

0 commit comments

Comments
 (0)