Skip to content

Commit

Permalink
Merge pull request #45 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Apr 4, 2024
2 parents 8bb654a + 637c715 commit 58f8a03
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## [Unreleased]
### Changed
- Client version updated on [5.2.13](https://github.com/reportportal/client-java/releases/tag/5.2.13), by @HardNorth
### Removed
- `OkHttp` dependency, by @HardNorth
- JSR-305 dependency, by @HardNorth

## [5.3.1]
### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Cucumber JVM version [6.0.0; ) adapter
[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-cucumber6.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.epam.reportportal/agent-java-cucumber6)
[![CI Build](https://github.com/reportportal/agent-java-cucumber6/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/agent-java-cucumber6/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/reportportal/agent-java-cucumber6/branch/develop/graph/badge.svg?token=GDQZ46X0H0)](https://codecov.io/gh/reportportal/agent-java-cucumber6)
[![Join Slack chat!](https://slack.epmrpp.reportportal.io/badge.svg)](https://slack.epmrpp.reportportal.io/)
[![Join Slack chat!](https://img.shields.io/badge/slack-join-brightgreen.svg)](https://slack.epmrpp.reportportal.io/)
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)

Expand Down
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,21 @@ repositories {
}

dependencies {
api 'com.epam.reportportal:client-java:5.2.4'
api 'com.google.code.findbugs:jsr305:3.0.2'
api 'com.epam.reportportal:client-java:5.2.13'

implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation "io.cucumber:cucumber-gherkin:${project.cucumber_version}"
implementation 'org.slf4j:slf4j-api:2.0.7'

testImplementation 'com.squareup.okhttp3:okhttp:4.12.0'
testImplementation "io.cucumber:cucumber-java:${project.cucumber_version}"
testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.2'
testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.6'
testImplementation "io.cucumber:cucumber-testng:${project.cucumber_version}"
testImplementation 'org.aspectj:aspectjweaver:1.9.19'
testImplementation 'org.hamcrest:hamcrest-core:2.2'
testImplementation 'org.mockito:mockito-core:3.3.3'
testImplementation 'org.mockito:mockito-junit-jupiter:3.3.3'
testImplementation 'ch.qos.logback:logback-classic:1.4.12'
testImplementation 'com.epam.reportportal:logger-java-logback:5.2.0'
testImplementation 'com.epam.reportportal:logger-java-logback:5.2.2'
testImplementation ("org.junit.platform:junit-platform-runner:${project.junit_runner_version}") {
exclude module: 'junit'
}
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.epam.reportportal.service.tree.TestItemTree;
import com.epam.reportportal.utils.*;
import com.epam.reportportal.utils.files.ByteSource;
import com.epam.reportportal.utils.http.ContentType;
import com.epam.reportportal.utils.markdown.MarkdownUtils;
import com.epam.reportportal.utils.properties.SystemAttributesExtractor;
import com.epam.reportportal.utils.reflect.Accessible;
Expand All @@ -40,7 +41,6 @@
import io.cucumber.plugin.ConcurrentEventListener;
import io.cucumber.plugin.event.*;
import io.reactivex.Maybe;
import okhttp3.MediaType;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -581,15 +581,7 @@ private static String getDataType(@Nonnull byte[] data, @Nullable String name) {
* @param data data to attach
*/
protected void embedding(@Nullable String name, @Nullable String mimeType, @Nonnull byte[] data) {
String type = ofNullable(mimeType).filter(m -> {
try {
MediaType.get(m);
return true;
} catch (IllegalArgumentException e) {
LOGGER.warn("Incorrect media type '{}'", m);
return false;
}
}).orElseGet(() -> getDataType(data, name));
String type = ofNullable(mimeType).filter(ContentType::isValidType).orElseGet(() -> getDataType(data, name));
String attachmentName = ofNullable(name).filter(m -> !m.isEmpty())
.orElseGet(() -> ofNullable(type).map(t -> t.substring(0, t.indexOf("/"))).orElse(""));
ReportPortal.emitLog(new ReportPortalMessage(ByteSource.wrap(data), type, attachmentName),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public void verify_text_embedding() {
.collect(Collectors.toList());

assertThat(types, hasSize(3));
assertThat(types, containsInAnyOrder("text/plain", "image/png", "application/octet-stream"));
assertThat(types, containsInAnyOrder("text/plain", "image/png", "text/plain"));
}

@Test
Expand Down

0 comments on commit 58f8a03

Please sign in to comment.