Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit f037997

Browse files
authored
Merge pull request #98 from reportportal/develop
Release
2 parents c5f3e06 + 68fce17 commit f037997

File tree

8 files changed

+183
-172
lines changed

8 files changed

+183
-172
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+
### Changed
5+
- Client version updated on [5.2.0](https://github.com/reportportal/client-java/releases/tag/5.2.0), by @HardNorth
46

57
## [5.1.4]
68
### Changed

README.md

Lines changed: 78 additions & 74 deletions
Large diffs are not rendered by default.

README_TEMPLATE.md

Lines changed: 72 additions & 71 deletions
Large diffs are not rendered by default.

build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ repositories {
3737
}
3838

3939
dependencies {
40-
api 'com.epam.reportportal:client-java:5.1.22'
40+
api 'com.epam.reportportal:client-java:5.2.1'
4141
api 'com.epam.reportportal:commons-model:5.0.0'
4242
api 'com.google.code.findbugs:jsr305:3.0.2'
4343
api 'info.cukes:gherkin:2.12.2'
4444

45+
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
4546
implementation 'org.slf4j:slf4j-api:2.0.7'
4647
implementation 'org.apache.commons:commons-text:1.10.0'
4748

@@ -53,8 +54,8 @@ dependencies {
5354
testImplementation 'org.hamcrest:hamcrest-core:2.2'
5455
testImplementation 'org.mockito:mockito-core:3.3.3'
5556
testImplementation 'org.mockito:mockito-junit-jupiter:3.3.3'
56-
testImplementation 'ch.qos.logback:logback-classic:1.3.8'
57-
testImplementation 'com.epam.reportportal:logger-java-logback:5.1.5'
57+
testImplementation 'ch.qos.logback:logback-classic:1.3.12'
58+
testImplementation 'com.epam.reportportal:logger-java-logback:5.2.0'
5859

5960
testImplementation ("org.junit.platform:junit-platform-runner:${project.junit_runner_version}") {
6061
exclude module: 'junit'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version=5.1.5-SNAPSHOT
1+
version=5.2.0-SNAPSHOT
22
description=EPAM Report portal. Cucumber JVM version [1.0.0; 2.0.0) adapter
33
cucumber_version=1.2.6
44
junit_version=5.6.3

src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
import com.epam.reportportal.service.item.TestCaseIdEntry;
2626
import com.epam.reportportal.service.tree.TestItemTree;
2727
import com.epam.reportportal.utils.*;
28+
import com.epam.reportportal.utils.files.ByteSource;
2829
import com.epam.reportportal.utils.properties.SystemAttributesExtractor;
2930
import com.epam.ta.reportportal.ws.model.FinishExecutionRQ;
3031
import com.epam.ta.reportportal.ws.model.FinishTestItemRQ;
3132
import com.epam.ta.reportportal.ws.model.ParameterResource;
3233
import com.epam.ta.reportportal.ws.model.StartTestItemRQ;
3334
import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ;
3435
import com.epam.ta.reportportal.ws.model.launch.StartLaunchRQ;
35-
import com.google.common.io.ByteSource;
3636
import gherkin.formatter.Argument;
3737
import gherkin.formatter.Formatter;
3838
import gherkin.formatter.Reporter;
@@ -128,6 +128,7 @@ public Launch get() {
128128
}
129129
});
130130

131+
@Nonnull
131132
public static ReportPortal getReportPortal() {
132133
return REPORT_PORTAL;
133134
}
@@ -169,7 +170,8 @@ private void addToTree(RunningContext.FeatureContext context) {
169170
* @param scenario Cucumber's Scenario object
170171
* @return scenario name
171172
*/
172-
protected String buildScenarioName(Scenario scenario) {
173+
@Nonnull
174+
protected String buildScenarioName(@Nonnull Scenario scenario) {
173175
return Utils.buildName(scenario.getKeyword(), COLON_INFIX, scenario.getName());
174176
}
175177

@@ -246,6 +248,7 @@ protected void beforeScenario(Scenario scenario, String outlineIteration) {
246248
// because it will be executed even if all Scenarios in the Feature are excluded.
247249
RunningContext.FeatureContext featureContext = currentFeatureContext.get();
248250
Launch myLaunch = launch.get();
251+
//noinspection ReactiveStreamsUnusedPublisher
249252
if (null == featureContext.getId()) {
250253
featureContext.setId(startFeature(featureContext.getItemRq()));
251254
addToTree(featureContext);
@@ -293,6 +296,7 @@ protected void finishTestItem(@Nullable Maybe<String> itemId, @Nullable ItemStat
293296
LOGGER.error("BUG: Trying to finish unspecified test item.");
294297
return;
295298
}
299+
//noinspection ReactiveStreamsUnusedPublisher
296300
launch.get().finishTestItem(itemId, buildFinishTestItemRequest(itemId, status));
297301
}
298302

@@ -302,7 +306,7 @@ protected void finishTestItem(@Nullable Maybe<String> itemId, @Nullable ItemStat
302306
protected void afterScenario() {
303307
RunningContext.ScenarioContext context = getCurrentScenarioContext();
304308
finishTestItem(context.getId(), context.getStatus());
305-
currentScenarioContext.set(null);
309+
currentScenarioContext.remove();
306310
removeFromTree(currentFeatureContext.get(), context);
307311
}
308312

@@ -342,6 +346,7 @@ protected void beforeFeature(Feature feature) {
342346
*/
343347
protected void afterFeature() {
344348
RunningContext.FeatureContext currentFeature = currentFeatureContext.get();
349+
//noinspection ReactiveStreamsUnusedPublisher
345350
if (null != currentFeature && null != currentFeature.getId()) {
346351
finishTestItem(currentFeature.getId());
347352
}
@@ -923,7 +928,7 @@ protected Set<ItemAttributesRQ> getAttributes(Match match) {
923928
protected String buildMultilineArgument(Step step) {
924929
StringBuilder marg = new StringBuilder();
925930
ofNullable(step.getRows()).map(rows -> rows.stream().map(Row::getCells).collect(Collectors.toList()))
926-
.filter(t -> t.size() > 0)
931+
.filter(t -> !t.isEmpty())
927932
.ifPresent(t -> marg.append(formatDataTable(t)));
928933
ofNullable(step.getDocString()).map(DocString::getValue)
929934
.filter(ds -> !ds.isEmpty())

src/main/java/com/epam/reportportal/cucumber/StepReporter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@
3636
* created in hooks will be attached to these, and not to the actual failing
3737
* steps!)
3838
*
39-
* @author Sergey_Gvozdyukevich
39+
* @deprecated Use {@link ScenarioReporter}, since the semantic of this class is completely broken and will be removed
4040
*/
41+
@Deprecated
4142
public class StepReporter extends AbstractReporter {
4243
private static final String RP_STORY_TYPE = "STORY";
4344
private static final String RP_TEST_TYPE = "SCENARIO";

src/main/java/com/epam/reportportal/cucumber/Utils.java

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@
1616
package com.epam.reportportal.cucumber;
1717

1818
import com.epam.reportportal.listeners.ItemStatus;
19-
import com.google.common.collect.ImmutableMap;
2019
import gherkin.formatter.Argument;
2120
import gherkin.formatter.model.Match;
2221

2322
import javax.annotation.Nonnull;
2423
import javax.annotation.Nullable;
2524
import java.lang.reflect.Field;
2625
import java.lang.reflect.Method;
27-
import java.util.Iterator;
28-
import java.util.List;
29-
import java.util.Map;
26+
import java.util.*;
3027
import java.util.function.Function;
3128
import java.util.stream.Collectors;
3229
import java.util.stream.IntStream;
@@ -42,21 +39,21 @@ public class Utils {
4239
public static final String TABLE_COLUMN_SEPARATOR = "|";
4340
public static final String TABLE_ROW_SEPARATOR = "-";
4441

45-
//@formatter:off
46-
public static final Map<String, ItemStatus> STATUS_MAPPING = ImmutableMap.<String, ItemStatus>builder()
47-
.put("passed", ItemStatus.PASSED)
48-
.put("failed", ItemStatus.FAILED)
49-
.put("skipped", ItemStatus.SKIPPED)
50-
.put("pending", ItemStatus.SKIPPED)
51-
.put("undefined", ItemStatus.SKIPPED).build();
42+
public static final Map<String, ItemStatus> STATUS_MAPPING = Collections.unmodifiableMap(new HashMap<String, ItemStatus>() {{
43+
put("passed", ItemStatus.PASSED);
44+
put("failed", ItemStatus.FAILED);
45+
put("skipped", ItemStatus.SKIPPED);
46+
put("pending", ItemStatus.SKIPPED);
47+
put("undefined", ItemStatus.SKIPPED);
48+
}});
5249

53-
public static final Map<String, String> LOG_LEVEL_MAPPING = ImmutableMap.<String, String>builder()
54-
.put("passed", "INFO")
55-
.put("failed", "ERROR")
56-
.put("skipped", "WARN")
57-
.put("pending", "WARN")
58-
.put("undefined", "WARN").build();
59-
//@formatter:on
50+
public static final Map<String, String> LOG_LEVEL_MAPPING = Collections.unmodifiableMap(new HashMap<String, String>() {{
51+
put("passed", "INFO");
52+
put("failed", "ERROR");
53+
put("skipped", "WARN");
54+
put("pending", "WARN");
55+
put("undefined", "WARN");
56+
}});
6057

6158
private Utils() {
6259
}

0 commit comments

Comments
 (0)