diff --git a/CHANGELOG.md b/CHANGELOG.md index adfdb54..c8dd3c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog ## [Unreleased] +### Added +- Test Case ID templating, by @HardNorth +### Changed +- Client version updated on [5.1.9](https://github.com/reportportal/client-java/releases/tag/5.1.9), by @HardNorth +- Slf4j version updated on 1.7.36, by @HardNorth +- Jbehave version was updated on version 4.8.3, by @HardNorth ## [5.1.1] ### Fixed diff --git a/README.md b/README.md index 8f76e2b..712be7e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ > ReportPortal team only and is not supposed for sharing with 3rd parties. [![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-jbehave.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-jbehave%22) -![CI Build](https://github.com/reportportal/agent-java-jbehave/workflows/CI%20Build/badge.svg?branch=develop) +[![CI Build](https://github.com/reportportal/agent-java-jbehave/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/agent-java-jbehave/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/reportportal/agent-java-jbehave/branch/develop/graph/badge.svg?token=BCglguEcoR)](https://codecov.io/gh/reportportal/agent-java-jbehave) [![Join Slack chat!](https://reportportal-slack-auto.herokuapp.com/badge.svg)](https://reportportal-slack-auto.herokuapp.com) [![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal) @@ -154,7 +154,7 @@ dependencies { testCompile "org.jbehave:jbehave-core:${jbehaveVersion}" testCompile "org.jbehave:jbehave-navigator:${jbehaveVersion}" testCompile 'com.epam.reportportal:agent-java-jbehave:5.1.1' - testCompile 'com.epam.reportportal:logger-java-logback:5.1.0' + testCompile 'com.epam.reportportal:logger-java-logback:5.1.1' } test { @@ -246,7 +246,7 @@ To route your logs into Report Portal you should add `logger-java-logback` depen ```groovy // inside 'dependencies' section -testCompile 'com.epam.reportportal:logger-java-logback:5.1.0' +testCompile 'com.epam.reportportal:logger-java-logback:5.1.1' ``` It should be already here if you used gradle configuration listed above. diff --git a/README_TEMPLATE.md b/README_TEMPLATE.md index d9e9bc9..147854d 100644 --- a/README_TEMPLATE.md +++ b/README_TEMPLATE.md @@ -5,7 +5,7 @@ > ReportPortal team only and is not supposed for sharing with 3rd parties. [![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-jbehave.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.epam.reportportal%22%20AND%20a:%22agent-java-jbehave%22) -![CI Build](https://github.com/reportportal/agent-java-jbehave/workflows/CI%20Build/badge.svg?branch=develop) +[![CI Build](https://github.com/reportportal/agent-java-jbehave/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/agent-java-jbehave/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/reportportal/agent-java-jbehave/branch/develop/graph/badge.svg?token=BCglguEcoR)](https://codecov.io/gh/reportportal/agent-java-jbehave) [![Join Slack chat!](https://reportportal-slack-auto.herokuapp.com/badge.svg)](https://reportportal-slack-auto.herokuapp.com) [![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal) @@ -154,7 +154,7 @@ dependencies { testCompile "org.jbehave:jbehave-core:${jbehaveVersion}" testCompile "org.jbehave:jbehave-navigator:${jbehaveVersion}" testCompile 'com.epam.reportportal:agent-java-jbehave:$LATEST_VERSION' - testCompile 'com.epam.reportportal:logger-java-logback:5.1.0' + testCompile 'com.epam.reportportal:logger-java-logback:5.1.1' } test { @@ -246,7 +246,7 @@ To route your logs into Report Portal you should add `logger-java-logback` depen ```groovy // inside 'dependencies' section -testCompile 'com.epam.reportportal:logger-java-logback:5.1.0' +testCompile 'com.epam.reportportal:logger-java-logback:5.1.1' ``` It should be already here if you used gradle configuration listed above. diff --git a/build.gradle b/build.gradle index bfec4c0..bbacacf 100644 --- a/build.gradle +++ b/build.gradle @@ -39,22 +39,22 @@ repositories { } dependencies { - api 'com.epam.reportportal:client-java:5.1.0' + api 'com.epam.reportportal:client-java:5.1.9' api 'com.epam.reportportal:commons-model:5.0.0' api ("org.jbehave:jbehave-core:${project.jbehave_version}") { exclude group: 'org.hamcrest' exclude group: 'junit' } api 'com.google.code.findbugs:jsr305:3.0.2' - implementation 'org.slf4j:slf4j-api:1.7.25' + implementation 'org.slf4j:slf4j-api:1.7.36' - testImplementation 'com.github.reportportal:agent-java-test-utils:ddcf50ee20' + testImplementation 'com.github.reportportal:agent-java-test-utils:236a68c' testImplementation 'org.aspectj:aspectjweaver:1.9.2' testImplementation 'org.hamcrest:hamcrest-core:2.2' testImplementation "org.mockito:mockito-core:${project.mockito_version}" testImplementation "org.mockito:mockito-junit-jupiter:${project.mockito_version}" - testImplementation 'ch.qos.logback:logback-classic:1.2.3' - testImplementation 'com.epam.reportportal:logger-java-logback:5.0.3' + testImplementation 'ch.qos.logback:logback-classic:1.2.11' + testImplementation 'com.epam.reportportal:logger-java-logback:5.1.1' testImplementation ("org.junit.platform:junit-platform-runner:${project.junit5_launcher_version}") { exclude module: 'junit' } diff --git a/gradle.properties b/gradle.properties index f4997e0..2e69f7b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ # version=5.1.2-SNAPSHOT description=JBehave reporters for Report Portal -jbehave_version=4.8.1 +jbehave_version=4.8.3 junit5_version=5.6.3 junit5_launcher_version=1.6.3 mockito_version=3.3.3 diff --git a/src/test/java/com/epam/reportportal/jbehave/BaseTest.java b/src/test/java/com/epam/reportportal/jbehave/BaseTest.java index 58959a2..82e4a00 100644 --- a/src/test/java/com/epam/reportportal/jbehave/BaseTest.java +++ b/src/test/java/com/epam/reportportal/jbehave/BaseTest.java @@ -58,7 +58,6 @@ import java.util.function.Predicate; import java.util.stream.Collectors; -import static com.epam.reportportal.util.test.CommonUtils.createMaybe; import static com.epam.reportportal.util.test.CommonUtils.generateUniqueId; import static java.util.Optional.ofNullable; import static org.hamcrest.MatcherAssert.assertThat; @@ -139,8 +138,8 @@ public static void mockLaunch(@Nonnull final ReportPortalClient client, @Nullabl public static > void mockLaunch(@Nonnull final ReportPortalClient client, @Nullable final String launchUuid, @Nullable final String storyUuid, @Nonnull final Collection> testSteps) { String launch = ofNullable(launchUuid).orElse(CommonUtils.namedId("launch_")); - when(client.startLaunch(any())).thenReturn(createMaybe(new StartLaunchRS(launch, 1L))); - when(client.finishLaunch(eq(launch), any())).thenReturn(createMaybe(new OperationCompletionRS())); + when(client.startLaunch(any())).thenReturn(Maybe.just(new StartLaunchRS(launch, 1L))); + when(client.finishLaunch(eq(launch), any())).thenReturn(Maybe.just(new OperationCompletionRS())); mockStory(client, storyUuid, testSteps); } @@ -158,16 +157,16 @@ public static > void mockStories(@Nonnull final Rep return; } String firstStory = stories.get(0).getKey(); - Maybe first = createMaybe(new ItemCreatedRS(firstStory, firstStory)); + Maybe first = Maybe.just(new ItemCreatedRS(firstStory, firstStory)); Maybe[] other = (Maybe[]) stories.subList(1, stories.size()) .stream() .map(Pair::getKey) - .map(s -> createMaybe(new ItemCreatedRS(s, s))) + .map(s -> Maybe.just(new ItemCreatedRS(s, s))) .toArray(Maybe[]::new); when(client.startTestItem(any())).thenReturn(first, other); stories.forEach(i -> { - Maybe rootFinishMaybe = createMaybe(new OperationCompletionRS()); + Maybe rootFinishMaybe = Maybe.just(new OperationCompletionRS()); when(client.finishTestItem(same(i.getKey()), any())).thenReturn(rootFinishMaybe); mockScenario(client, i.getKey(), i.getValue()); }); @@ -178,7 +177,7 @@ public static > void mockScenario(@Nonnull final Re @Nonnull final String storyUuid, @Nonnull final Collection> testSteps) { List> testResponses = testSteps.stream() .map(Pair::getKey) - .map(uuid -> createMaybe(new ItemCreatedRS(uuid, uuid))) + .map(uuid -> Maybe.just(new ItemCreatedRS(uuid, uuid))) .collect(Collectors.toList()); Maybe first = testResponses.get(0); @@ -189,23 +188,23 @@ public static > void mockScenario(@Nonnull final Re String testClassUuid = test.getKey(); List> stepResponses = test.getValue() .stream() - .map(uuid -> createMaybe(new ItemCreatedRS(uuid, uuid))) + .map(uuid -> Maybe.just(new ItemCreatedRS(uuid, uuid))) .collect(Collectors.toList()); - when(client.finishTestItem(same(testClassUuid), any())).thenReturn(createMaybe(new OperationCompletionRS())); + when(client.finishTestItem(same(testClassUuid), any())).thenReturn(Maybe.just(new OperationCompletionRS())); if (!stepResponses.isEmpty()) { Maybe myFirst = stepResponses.get(0); Maybe[] myOther = stepResponses.subList(1, stepResponses.size()).toArray(new Maybe[0]); when(client.startTestItem(same(testClassUuid), any())).thenReturn(myFirst, myOther); new HashSet<>(test.getValue()).forEach(testMethodUuid -> when(client.finishTestItem(same(testMethodUuid), any() - )).thenReturn(createMaybe(new OperationCompletionRS()))); + )).thenReturn(Maybe.just(new OperationCompletionRS()))); } }); } @SuppressWarnings("unchecked") public static void mockBatchLogging(final ReportPortalClient client) { - when(client.log(any(List.class))).thenReturn(createMaybe(new BatchSaveOperatingRS())); + when(client.log(any(List.class))).thenReturn(Maybe.just(new BatchSaveOperatingRS())); } public static void mockNestedSteps(final ReportPortalClient client, final Pair parentNestedPair) { @@ -218,7 +217,7 @@ public static void mockNestedSteps(final ReportPortalClient client, final List

{ List> responses = v.stream() - .map(uuid -> createMaybe(new ItemCreatedRS(uuid, uuid))) + .map(uuid -> Maybe.just(new ItemCreatedRS(uuid, uuid))) .collect(Collectors.toList()); Maybe first = responses.get(0); @@ -227,7 +226,7 @@ public static void mockNestedSteps(final ReportPortalClient client, final List

when(client.finishTestItem(same(p.getValue()), any() - )).thenAnswer((Answer>) invocation -> createMaybe(new OperationCompletionRS()))); + )).thenAnswer((Answer>) invocation -> Maybe.just(new OperationCompletionRS()))); } public static ListenerParameters standardParameters() { diff --git a/src/test/java/com/epam/reportportal/jbehave/CallbackReportingTest.java b/src/test/java/com/epam/reportportal/jbehave/CallbackReportingTest.java index 6555232..8c30cef 100644 --- a/src/test/java/com/epam/reportportal/jbehave/CallbackReportingTest.java +++ b/src/test/java/com/epam/reportportal/jbehave/CallbackReportingTest.java @@ -24,6 +24,7 @@ import com.epam.ta.reportportal.ws.model.EntryCreatedAsyncRS; import com.epam.ta.reportportal.ws.model.FinishTestItemRQ; import com.epam.ta.reportportal.ws.model.log.SaveLogRQ; +import io.reactivex.Maybe; import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -62,7 +63,7 @@ public class CallbackReportingTest extends BaseTest { @BeforeEach public void setup() { mockLaunch(client, launchId, suiteId, tests); - when(client.log(any(SaveLogRQ.class))).thenReturn(CommonUtils.createMaybe(new EntryCreatedAsyncRS())); + when(client.log(any(SaveLogRQ.class))).thenReturn(Maybe.just(new EntryCreatedAsyncRS())); } private static final String STORY_PATH = "stories/CallbackReportingScenario.story";