diff --git a/CHANGELOG.md b/CHANGELOG.md index b03402c..096bf5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 21c04f0..5dc7848 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/build.gradle b/build.gradle index 5f46087..181f0c8 100644 --- a/build.gradle +++ b/build.gradle @@ -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' } diff --git a/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java b/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java index 854eec7..e3519c4 100644 --- a/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java +++ b/src/main/java/com/epam/reportportal/cucumber/AbstractReporter.java @@ -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; @@ -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; @@ -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), diff --git a/src/test/java/com/epam/reportportal/cucumber/EmbeddingTest.java b/src/test/java/com/epam/reportportal/cucumber/EmbeddingTest.java index 65e2806..83f482d 100644 --- a/src/test/java/com/epam/reportportal/cucumber/EmbeddingTest.java +++ b/src/test/java/com/epam/reportportal/cucumber/EmbeddingTest.java @@ -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