From e2e13f042f3af3b5f60b745935625fa5146e19e3 Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Tue, 2 Apr 2024 14:28:51 +0300 Subject: [PATCH] Additional constructor with `Socket` argument in `SocketUtils.ServerCallable` class --- CHANGELOG.md | 2 ++ .../epam/reportportal/util/test/SocketUtils.java | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17bd474..0ef043c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Added +- Additional constructor with `Socket` argument in `SocketUtils.ServerCallable` class, by @HardNorth ## [0.0.4] ### Changed diff --git a/src/main/java/com/epam/reportportal/util/test/SocketUtils.java b/src/main/java/com/epam/reportportal/util/test/SocketUtils.java index 9df6fa4..872da6e 100644 --- a/src/main/java/com/epam/reportportal/util/test/SocketUtils.java +++ b/src/main/java/com/epam/reportportal/util/test/SocketUtils.java @@ -19,6 +19,8 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.tuple.Pair; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -46,13 +48,21 @@ public static final class ServerCallable implements Callable> { private final List responseFiles; private Socket s; - public ServerCallable(ServerSocket serverSocket, Map replacementValues, List responseFilePaths) { + public ServerCallable(@Nonnull ServerSocket serverSocket, @Nullable Socket socket, @Nonnull Map replacementValues, + @Nonnull List responseFilePaths) { ss = serverSocket; + s = socket; model = replacementValues; responseFiles = responseFilePaths; } - public ServerCallable(ServerSocket serverSocket, Map replacementValues, String responseFilePath) { + public ServerCallable(@Nonnull ServerSocket serverSocket, @Nonnull Map replacementValues, + @Nonnull List responseFilePaths) { + this(serverSocket, null, replacementValues, responseFilePaths); + } + + public ServerCallable(@Nonnull ServerSocket serverSocket, @Nonnull Map replacementValues, + @Nonnull String responseFilePath) { this(serverSocket, replacementValues, Collections.singletonList(responseFilePath)); }