Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #27

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.2.1]
### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Cucumber JVM version [5.0.0;6.0.0) adapter
[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/agent-java-cucumber5.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.epam.reportportal/agent-java-cucumber5)
[![CI Build](https://github.com/reportportal/agent-java-cucumber5/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/agent-java-cucumber5/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/reportportal/agent-java-cucumber5/branch/develop/graph/badge.svg?token=DU2YT94108)](https://codecov.io/gh/reportportal/agent-java-cucumber5)
[![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)


For more info see https://github.com/reportportal/agent-java-cucumber
For more info see https://github.com/reportportal/agent-java-cucumber
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,20 @@ 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'
api "io.cucumber:cucumber-java:${project.cucumber_version}"

implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'org.slf4j:slf4j-api:2.0.7'

testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.2'
testImplementation 'com.squareup.okhttp3:okhttp:4.12.0'
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.3.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 @@ -42,7 +43,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 @@ -488,15 +488,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 @@ -156,7 +156,7 @@ public void verify_text_embedding() {
List<String> types = getTypes(logCaptor, logs);

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
Loading