Skip to content

Commit

Permalink
Client version update
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Jan 11, 2024
1 parent 429fe4f commit 8063c88
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 110 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## [Unreleased]
### Changed
- Client version updated on [5.1.25](https://github.com/reportportal/client-java/releases/tag/5.1.25), by @HardNorth
- Client version updated on [5.2.0](https://github.com/reportportal/client-java/releases/tag/5.2.0), by @HardNorth
### Removed
- HttpCore dependency was removed to avoid conflicts, by @HardNorth

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repositories {
}

dependencies {
api 'com.epam.reportportal:client-java:5.1.27'
api 'com.epam.reportportal:client-java:5.2.0'
api 'com.google.code.findbugs:jsr305:3.0.2'
api 'com.epam.reportportal:commons-model:5.0.0'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.formatting;

import com.epam.reportportal.formatting.http.ContentType;
import com.epam.reportportal.formatting.http.HttpFormatter;
import com.epam.reportportal.formatting.http.HttpPartFormatter;
import com.epam.reportportal.formatting.http.HttpRequestFormatter;
Expand All @@ -29,7 +28,8 @@
import com.epam.reportportal.service.Launch;
import com.epam.reportportal.service.ReportPortal;
import com.epam.reportportal.service.step.StepReporter;
import com.google.common.io.ByteSource;
import com.epam.reportportal.utils.files.ByteSource;
import com.epam.reportportal.utils.http.ContentType;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down
31 changes: 16 additions & 15 deletions src/main/java/com/epam/reportportal/formatting/http/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.epam.reportportal.formatting.http.prettiers.HtmlPrettier;
import com.epam.reportportal.formatting.http.prettiers.JsonPrettier;
import com.epam.reportportal.formatting.http.prettiers.XmlPrettier;
import com.epam.reportportal.utils.http.ContentType;

import java.util.*;
import java.util.function.Function;
Expand Down Expand Up @@ -48,11 +49,11 @@ public class Constants {

public static final Set<String> TEXT_TYPES =
Collections.unmodifiableSet(new HashSet<>(Arrays.asList(ContentType.APPLICATION_JSON,
ContentType.TEXT_PLAIN,
ContentType.TEXT_HTML,
ContentType.TEXT_XML,
ContentType.APPLICATION_XML
)));
ContentType.TEXT_PLAIN,
ContentType.TEXT_HTML,
ContentType.TEXT_XML,
ContentType.APPLICATION_XML
)));

public static final Set<String> FORM_TYPES = Collections.singleton(ContentType.APPLICATION_FORM_URLENCODED);

Expand All @@ -64,16 +65,16 @@ public class Constants {

public static final Map<String, Function<String, String>> DEFAULT_PRETTIERS =
Collections.unmodifiableMap(new HashMap<String, Function<String, String>>() {{
put(ContentType.APPLICATION_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_SOAP_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_ATOM_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_SVG_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_XHTML_XML, XmlPrettier.INSTANCE);
put(ContentType.TEXT_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_JSON, JsonPrettier.INSTANCE);
put("text/json", JsonPrettier.INSTANCE);
put(ContentType.TEXT_HTML, HtmlPrettier.INSTANCE);
}});
put(ContentType.APPLICATION_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_SOAP_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_ATOM_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_SVG_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_XHTML_XML, XmlPrettier.INSTANCE);
put(ContentType.TEXT_XML, XmlPrettier.INSTANCE);
put(ContentType.APPLICATION_JSON, JsonPrettier.INSTANCE);
put("text/json", JsonPrettier.INSTANCE);
put(ContentType.TEXT_HTML, HtmlPrettier.INSTANCE);
}});

private Constants() {
throw new RuntimeException("No instances should exist for the class!");
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.epam.reportportal.formatting.http.entities.Cookie;
import com.epam.reportportal.formatting.http.entities.Header;
import com.epam.reportportal.formatting.http.entities.Param;
import com.epam.reportportal.utils.http.ContentType;
import org.apache.commons.lang3.tuple.Pair;

import javax.annotation.Nonnull;
Expand Down Expand Up @@ -67,7 +68,7 @@ public static String joinParts(@Nonnull String delimiter, @Nullable String... pa

@Nonnull
public static <T> String format(@Nullable List<T> entities, @Nonnull Function<T, String> converter,
@Nullable String tag) {
@Nullable String tag) {
String prefix = tag == null ? "" : tag + LINE_DELIMITER;
if (entities == null || entities.isEmpty()) {
return "";
Expand All @@ -80,7 +81,7 @@ public static <T> String format(@Nullable List<T> entities, @Nonnull Function<T,

@Nonnull
public static String formatHeaders(@Nullable List<Header> headers,
@Nullable Function<Header, String> headerConverter) {
@Nullable Function<Header, String> headerConverter) {
return format(headers,
headerConverter == null ? DefaultHttpHeaderConverter.INSTANCE : headerConverter,
HEADERS_TAG
Expand All @@ -89,7 +90,7 @@ public static String formatHeaders(@Nullable List<Header> headers,

@Nonnull
public static String formatCookies(@Nullable List<Cookie> cookies,
@Nullable Function<Cookie, String> cookieConverter) {
@Nullable Function<Cookie, String> cookieConverter) {
return format(cookies,
cookieConverter == null ? DefaultCookieConverter.INSTANCE : cookieConverter,
COOKIES_TAG
Expand All @@ -98,7 +99,7 @@ public static String formatCookies(@Nullable List<Cookie> cookies,

@Nonnull
public static String formatText(@Nullable String header, @Nullable List<Param> params, @Nullable String tag,
@Nullable Function<Param, String> paramConverter) {
@Nullable Function<Param, String> paramConverter) {
if (params == null || params.isEmpty()) {
return header == null ? "" : header;
}
Expand All @@ -114,7 +115,7 @@ public static String formatText(@Nullable String header, @Nullable List<Param> p

@Nonnull
public static String formatText(@Nullable String header, @Nullable String body, @Nullable String tag,
@Nullable Map<String, Function<String, String>> contentPrettiers, String contentType) {
@Nullable Map<String, Function<String, String>> contentPrettiers, String contentType) {
Map<String, Function<String, String>> prettiers = contentPrettiers;
if (contentPrettiers == null) {
prettiers = Collections.emptyMap();
Expand Down Expand Up @@ -162,9 +163,9 @@ public static Stream<Pair<String, String>> toKeyValue(@Nonnull String headerValu

@Nonnull
public static Cookie toCookie(@Nonnull String name, @Nullable String value, @Nullable String comment,
@Nullable String path, @Nullable String domain, @Nullable Long maxAge, @Nullable Boolean secured,
@Nullable Boolean httpOnly, @Nullable Date expiryDate, @Nullable Integer version,
@Nullable String sameSite) {
@Nullable String path, @Nullable String domain, @Nullable Long maxAge, @Nullable Boolean secured,
@Nullable Boolean httpOnly, @Nullable Date expiryDate, @Nullable Integer version,
@Nullable String sameSite) {
Cookie cookie = new Cookie(name);
cookie.setValue(value);
cookie.setComment(comment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.epam.reportportal.formatting.http.entities.Cookie;
import com.epam.reportportal.formatting.http.entities.Header;
import com.epam.reportportal.formatting.http.entities.Param;
import com.epam.reportportal.utils.http.ContentType;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -232,7 +233,7 @@ public Builder addCookie(Cookie cookie) {
}

public Builder addCookie(String name, String value, String comment, String path, String domain, Long maxAge,
Boolean secured, Boolean httpOnly, Date expiryDate, Integer version, String sameSite) {
Boolean secured, Boolean httpOnly, Date expiryDate, Integer version, String sameSite) {
return addCookie(HttpFormatUtils.toCookie(name,
value,
comment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public Builder addCookie(Cookie cookie) {
}

public Builder addCookie(String name, String value, String comment, String path, String domain, Long maxAge,
Boolean secured, Boolean httpOnly, Date expiryDate, Integer version, String sameSite) {
Boolean secured, Boolean httpOnly, Date expiryDate, Integer version, String sameSite) {
return addCookie(HttpFormatUtils.toCookie(name,
value,
comment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.epam.reportportal.formatting.http.converters;

import com.epam.reportportal.formatting.http.entities.Header;
import com.google.common.net.HttpHeaders;

import javax.annotation.Nullable;
import java.util.Collections;
Expand All @@ -30,7 +29,7 @@

public class SanitizingHttpHeaderConverter implements Function<Header, String> {
public static final Set<String> SENSITIVE_HEADERS = Collections.unmodifiableSet(new HashSet<>(Collections.singletonList(
HttpHeaders.AUTHORIZATION)));
"Authorization")));

public static final Function<Header, String> INSTANCE = new SanitizingHttpHeaderConverter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public String apply(String uriStr) {
.map(info -> info.split(":", 2))
.map(info -> {
if (info.length > 1) {
return new String[] { info[0], REMOVED_TAG };
return new String[]{info[0], REMOVED_TAG};
}
return info;
})
Expand Down

0 comments on commit 8063c88

Please sign in to comment.