Skip to content

Commit bb495e1

Browse files
committed
Some data cleanup in ReportPortalHook class
1 parent 9744372 commit bb495e1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- Some data cleanup in `ReportPortalHook` class, by @HardNorth
46

57
## [5.3.1]
68
### Added

src/main/java/com/epam/reportportal/karate/ReportPortalHook.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ protected FinishTestItemRQ buildFinishFeatureRq(@Nonnull FeatureRuntime fr) {
200200

201201
@Override
202202
public void afterFeature(FeatureRuntime fr) {
203-
Optional<Maybe<String>> optionalId = ofNullable(featureIdMap.get(getFeatureNameForReport(fr))).map(Supplier::get);
203+
Optional<Maybe<String>> optionalId = ofNullable(featureIdMap.remove(getFeatureNameForReport(fr))).map(Supplier::get);
204204
if (optionalId.isEmpty()) {
205205
LOGGER.error("ERROR: Trying to finish unspecified feature.");
206206
}
@@ -342,7 +342,7 @@ protected void embedAttachments(@Nonnull Maybe<String> itemId, @Nullable List<Em
342342

343343
@Override
344344
public void afterScenario(ScenarioRuntime sr) {
345-
Maybe<String> scenarioId = scenarioIdMap.get(sr.scenario.getUniqueId());
345+
Maybe<String> scenarioId = scenarioIdMap.remove(sr.scenario.getUniqueId());
346346
finishBackground(null, sr);
347347

348348
if (scenarioId == null) {
@@ -490,7 +490,7 @@ public void afterStep(StepResult stepResult, ScenarioRuntime sr) {
490490
}
491491

492492
sendStepResults(stepResult, sr);
493-
Maybe<String> stepId = stepIdMap.get(sr.scenario.getUniqueId());
493+
Maybe<String> stepId = stepIdMap.remove(sr.scenario.getUniqueId());
494494
if (stepId == null) {
495495
LOGGER.error("ERROR: Trying to finish unspecified step.");
496496
return;

0 commit comments

Comments
 (0)