From 2f8b018a7174437e67c77c937ac7253c4da6eff1 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Thu, 14 Nov 2024 15:37:38 +0300 Subject: [PATCH 1/4] Minor style fix --- .../com/epam/reportportal/karate/ReportPortalPublisher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/reportportal/karate/ReportPortalPublisher.java b/src/main/java/com/epam/reportportal/karate/ReportPortalPublisher.java index d78382f..b66999b 100644 --- a/src/main/java/com/epam/reportportal/karate/ReportPortalPublisher.java +++ b/src/main/java/com/epam/reportportal/karate/ReportPortalPublisher.java @@ -298,7 +298,7 @@ public void finishBackground(@Nullable StepResult stepResult, @Nonnull ScenarioR private Date getStepStartTime(@Nonnull Maybe stepId) { long currentStepStartTime = Calendar.getInstance().getTime().getTime(); - if (!stepStartTimeMap.keySet().isEmpty()) { + if (!stepStartTimeMap.isEmpty()) { long lastStepStartTime = stepStartTimeMap.get(stepId); if (lastStepStartTime >= currentStepStartTime) { From 6a46643ca89dc4e212f5167abce12db7be2c32a8 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 21 Jan 2025 12:50:30 +0300 Subject: [PATCH 2/4] Client version update --- CHANGELOG.md | 2 ++ gradle.properties | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9c06e..064dd5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Changed +- Client version updated on [5.2.25](https://github.com/reportportal/client-java/releases/tag/5.2.25), by @HardNorth ## [5.1.2] ### Changed diff --git a/gradle.properties b/gradle.properties index f590fa8..392129e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,10 +5,10 @@ gradle_version=8.2 karate_version=1.4.1 junit_version=5.10.1 mockito_version=5.4.0 -test_utils_version=0.0.3 -client_version=5.2.15 +test_utils_version=0.0.7 +client_version=5.2.25 slf4j_api_version=2.0.7 -logger_version=5.2.2 +logger_version=5.2.3 hamcrest_version=2.2 okhttp_version=4.12.0 scripts_url=https://raw.githubusercontent.com/reportportal/gradle-scripts From d3d85fd6c90f60541b6d28bd22aeb0bb36048e0d Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 21 Jan 2025 12:55:10 +0300 Subject: [PATCH 3/4] Fix constant references --- .../java/com/epam/reportportal/karate/ReportPortalUtils.java | 2 +- .../reportportal/karate/call/CallWithParametersHookTest.java | 2 +- .../karate/description/NoDescriptionExamplesTest.java | 2 +- ...enarioDescriptionErrorLogWithDescriptionAndExamplesTest.java | 2 +- .../ScenarioDescriptionErrorLogWithExamplesTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java b/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java index 7ad60aa..c9329a0 100644 --- a/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java +++ b/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java @@ -25,7 +25,7 @@ import com.epam.reportportal.utils.AttributeParser; import com.epam.reportportal.utils.ParameterUtils; import com.epam.reportportal.utils.TestCaseIdUtils; -import com.epam.reportportal.utils.markdown.MarkdownUtils; +import com.epam.reportportal.utils.formatting.MarkdownUtils; import com.epam.reportportal.utils.properties.SystemAttributesExtractor; import com.epam.ta.reportportal.ws.model.FinishExecutionRQ; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; diff --git a/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java b/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java index b360083..a012116 100644 --- a/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java +++ b/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java @@ -20,7 +20,7 @@ import com.epam.reportportal.service.ReportPortal; import com.epam.reportportal.service.ReportPortalClient; import com.epam.reportportal.util.test.CommonUtils; -import com.epam.reportportal.utils.markdown.MarkdownUtils; +import com.epam.reportportal.utils.formatting.MarkdownUtils; import com.epam.ta.reportportal.ws.model.StartTestItemRQ; import com.intuit.karate.Results; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/test/java/com/epam/reportportal/karate/description/NoDescriptionExamplesTest.java b/src/test/java/com/epam/reportportal/karate/description/NoDescriptionExamplesTest.java index 340d728..55cf9a7 100644 --- a/src/test/java/com/epam/reportportal/karate/description/NoDescriptionExamplesTest.java +++ b/src/test/java/com/epam/reportportal/karate/description/NoDescriptionExamplesTest.java @@ -20,7 +20,7 @@ import com.epam.reportportal.service.ReportPortal; import com.epam.reportportal.service.ReportPortalClient; import com.epam.reportportal.util.test.CommonUtils; -import com.epam.reportportal.utils.markdown.MarkdownUtils; +import com.epam.reportportal.utils.formatting.MarkdownUtils; import com.epam.ta.reportportal.ws.model.StartTestItemRQ; import com.intuit.karate.Results; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java b/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java index 27bd500..a532c86 100644 --- a/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java +++ b/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java @@ -22,7 +22,7 @@ import com.epam.reportportal.service.ReportPortal; import com.epam.reportportal.service.ReportPortalClient; import com.epam.reportportal.util.test.CommonUtils; -import com.epam.reportportal.utils.markdown.MarkdownUtils; +import com.epam.reportportal.utils.formatting.MarkdownUtils; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; import com.epam.ta.reportportal.ws.model.log.SaveLogRQ; import com.intuit.karate.Results; diff --git a/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithExamplesTest.java b/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithExamplesTest.java index 9b98368..81ca439 100644 --- a/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithExamplesTest.java +++ b/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithExamplesTest.java @@ -22,7 +22,7 @@ import com.epam.reportportal.service.ReportPortal; import com.epam.reportportal.service.ReportPortalClient; import com.epam.reportportal.util.test.CommonUtils; -import com.epam.reportportal.utils.markdown.MarkdownUtils; +import com.epam.reportportal.utils.formatting.MarkdownUtils; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; import com.epam.ta.reportportal.ws.model.log.SaveLogRQ; import com.intuit.karate.Results; From 721a0e33938315a2437c5188f5371b7625b7b724 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 21 Jan 2025 13:09:11 +0300 Subject: [PATCH 4/4] Fix tests --- .../java/com/epam/reportportal/karate/ReportPortalUtils.java | 2 +- .../reportportal/karate/call/CallWithParametersHookTest.java | 2 +- ...enarioDescriptionErrorLogWithDescriptionAndExamplesTest.java | 2 +- .../reportportal/karate/description/SimpleDescriptionTest.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java b/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java index c9329a0..6fac584 100644 --- a/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java +++ b/src/main/java/com/epam/reportportal/karate/ReportPortalUtils.java @@ -61,7 +61,7 @@ public class ReportPortalUtils { public static final String SKIPPED_ISSUE_KEY = "skippedIssue"; public static final String SCENARIO_CODE_REFERENCE_PATTERN = "%s/[SCENARIO:%s]"; public static final String EXAMPLE_CODE_REFERENCE_PATTERN = "%s/[EXAMPLE:%s%s]"; - public static final String MARKDOWN_DELIMITER = "\n" + MarkdownUtils.LOGICAL_SEPARATOR + "\n"; + public static final String MARKDOWN_DELIMITER = MarkdownUtils.LOGICAL_SEPARATOR; public static final String MARKDOWN_DELIMITER_PATTERN = "%s" + MARKDOWN_DELIMITER + "%s"; public static final String FEATURE_TAG = "Feature: "; public static final String SCENARIO_TAG = "Scenario: "; diff --git a/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java b/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java index a012116..b1f06e8 100644 --- a/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java +++ b/src/test/java/com/epam/reportportal/karate/call/CallWithParametersHookTest.java @@ -47,7 +47,7 @@ public class CallWithParametersHookTest { private static final String PARAMETERS_DESCRIPTION_PATTERN = "Parameters:\n\n" + MarkdownUtils.TABLE_INDENT + "|\u00A0vara\u00A0|\u00A0result\u00A0|\n" + MarkdownUtils.TABLE_INDENT + "|------|--------|\n" + MarkdownUtils.TABLE_INDENT - + "|\u00A0\u00A02\u00A0\u00A0\u00A0|\u00A0\u00A0\u00A04\u00A0\u00A0\u00A0\u00A0|\n" + + "|\u00A0\u00A02\u00A0\u00A0\u00A0|\u00A0\u00A0\u00A04\u00A0\u00A0\u00A0\u00A0|\n\n" + MarkdownUtils.TABLE_ROW_SEPARATOR; private final String featureId = CommonUtils.namedId("feature_"); private final String scenarioId = CommonUtils.namedId("scenario_"); diff --git a/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java b/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java index a532c86..a586ef7 100644 --- a/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java +++ b/src/test/java/com/epam/reportportal/karate/description/ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest.java @@ -48,7 +48,7 @@ public class ScenarioDescriptionErrorLogWithDescriptionAndExamplesTest { - public static final String MARKDOWN_DELIMITER_PATTERN_THREE_ARGS = "%s\n---\n%s\n---\n%s"; + public static final String MARKDOWN_DELIMITER_PATTERN_THREE_ARGS = "%s\n\n---\n\n%s\n\n---\n\n%s"; public static final String ERROR = "did not evaluate to 'true': mathResult == 5\nclasspath:feature/simple_failed_description_examples.feature:8"; public static final String ERROR_MESSAGE = "Then assert mathResult == 5\n" + ERROR; public static final String DESCRIPTION_ERROR_LOG = "Error:\n" + ERROR; diff --git a/src/test/java/com/epam/reportportal/karate/description/SimpleDescriptionTest.java b/src/test/java/com/epam/reportportal/karate/description/SimpleDescriptionTest.java index 613502c..2e621e7 100644 --- a/src/test/java/com/epam/reportportal/karate/description/SimpleDescriptionTest.java +++ b/src/test/java/com/epam/reportportal/karate/description/SimpleDescriptionTest.java @@ -78,7 +78,7 @@ public void test_description_for_all_possible_items(boolean report) { verify(client, times(3)).startTestItem(same(scenarioId), stepCaptor.capture()); StartTestItemRQ featureStart = featureCaptor.getValue(); - assertThat(featureStart.getDescription(), endsWith("feature/description.feature\n---\nThis is my Feature description.")); + assertThat(featureStart.getDescription(), endsWith("feature/description.feature\n\n---\n\nThis is my Feature description.")); StartTestItemRQ scenarioStart = scenarioCaptor.getValue(); assertThat(scenarioStart.getDescription(), equalTo(SCENARIO_DESCRIPTION));