You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2026/10/10 13:06:28 UTC
(httpcomponents-client) branch master updated (e37a0e316 -> 18f2961e7)
This is an automated email from the ASF dual-hosted git repository.
ok2c pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
from e37a0e316 Use Mockito JUnit extension to wire tests with Mockito mocks
new 83af12613 Upgraded Testcontainers to version 2.0.5
new 6681f287d Upgraded maven-surefire-plugin to the version defined in HC Parent
new 18f2961e7 Replaced System.out calls with logging in tests
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
httpclient5-testing/pom.xml | 2 +-
.../client5/testing/sync/TestClientAuthentication.java | 4 ++--
.../client5/testing/websocket/WebSocketClientTest.java | 18 +++++++++++-------
pom.xml | 9 ++-------
4 files changed, 16 insertions(+), 17 deletions(-)
(httpcomponents-client) 03/03: Replaced System.out calls with logging in tests
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ok2c pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit 18f2961e7804ee0a59322265aa1c8899baca784f
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Oct 10 15:02:19 2026 +0200
Replaced System.out calls with logging in tests
---
.../client5/testing/websocket/WebSocketClientTest.java | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/websocket/WebSocketClientTest.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/websocket/WebSocketClientTest.java
index 0fd08a345..f32cab36e 100644
--- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/websocket/WebSocketClientTest.java
+++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/websocket/WebSocketClientTest.java
@@ -52,9 +52,13 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
final class WebSocketClientTest {
+ private static final Logger LOG = LoggerFactory.getLogger(WebSocketClientTest.class);
+
private WebSocketServer server;
private int port;
@@ -106,7 +110,7 @@ void echo_uncompressed() throws Exception {
final StringBuilder echoed = new StringBuilder();
final AtomicReference<WebSocket> wsRef = new AtomicReference<>();
- System.out.println("[TEST] connecting: " + uri);
+ LOG.info("[TEST] connecting: {}", uri);
final WebSocketListener listener = new WebSocketListener() {
@@ -114,17 +118,17 @@ void echo_uncompressed() throws Exception {
public void onOpen(final WebSocket ws) {
wsRef.set(ws);
final String payload = buildPayload();
- System.out.println("[TEST] open: " + uri);
+ LOG.info("[TEST] open: {}", uri);
final boolean sent = ws.sendText(payload, true);
- System.out.println("[TEST] sent (chars=" + payload.length() + ") sent=" + sent);
+ LOG.info("[TEST] sent (chars={}) sent={}", payload.length(), sent);
}
@Override
public void onText(final CharBuffer text, final boolean last) {
echoed.append(text);
if (last) {
- System.out.println("[TEST] text (chars=" + text.length() + "): " +
- (text.length() > 80 ? text.subSequence(0, 80) + "…" : text));
+ LOG.info("[TEST] text (chars={}): {}", text.length(),
+ text.length() > 80 ? text.subSequence(0, 80) + "…" : text);
final WebSocket ws = wsRef.get();
if (ws != null) {
ws.close(1000, "done");
@@ -135,7 +139,7 @@ public void onText(final CharBuffer text, final boolean last) {
@Override
public void onClose(final int code, final String reason) {
try {
- System.out.println("[TEST] close: " + code + " " + reason);
+ LOG.info("[TEST] close: {} {}", code, reason);
assertEquals(1000, code);
assertTrue(echoed.length() > 0, "No text echoed back");
} finally {
@@ -145,7 +149,7 @@ public void onClose(final int code, final String reason) {
@Override
public void onError(final Throwable ex) {
- ex.printStackTrace(System.out);
+ LOG.error(ex.getMessage(), ex);
errorRef.set(ex);
done.countDown();
}
(httpcomponents-client) 01/03: Upgraded Testcontainers to version 2.0.5
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ok2c pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit 83af1261313578d7e61dad5f71c26f9f9b6164cc
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Oct 10 14:49:15 2026 +0200
Upgraded Testcontainers to version 2.0.5
---
httpclient5-testing/pom.xml | 2 +-
.../org/apache/hc/client5/testing/sync/TestClientAuthentication.java | 4 ++--
pom.xml | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/httpclient5-testing/pom.xml b/httpclient5-testing/pom.xml
index e0cfd61b8..0fad6b462 100644
--- a/httpclient5-testing/pom.xml
+++ b/httpclient5-testing/pom.xml
@@ -115,7 +115,7 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
- <artifactId>junit-jupiter</artifactId>
+ <artifactId>testcontainers-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestClientAuthentication.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestClientAuthentication.java
index da7767e3a..7b8bf7900 100644
--- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestClientAuthentication.java
+++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestClientAuthentication.java
@@ -26,7 +26,7 @@
*/
package org.apache.hc.client5.testing.sync;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.testcontainers.shaded.org.hamcrest.MatcherAssert.assertThat;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
@@ -87,10 +87,10 @@
import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.http.support.BasicResponseBuilder;
import org.apache.hc.core5.net.URIAuthority;
-import org.hamcrest.CoreMatchers;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
+import org.testcontainers.shaded.org.hamcrest.CoreMatchers;
/**
* Unit tests for automatic client authentication.
diff --git a/pom.xml b/pom.xml
index 9fdc85403..4fbf48e38 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,7 +82,7 @@
<mockito.version>4.11.0</mockito.version>
<hc.stylecheck.version>1</hc.stylecheck.version>
<rxjava3.version>3.1.12</rxjava3.version>
- <testcontainers.version>1.21.4</testcontainers.version>
+ <testcontainers.version>2.0.5</testcontainers.version>
<junixsocket.version>2.10.1</junixsocket.version>
<commons.compress.version>1.28.0</commons.compress.version>
<zstd.jni.version>1.5.7-11</zstd.jni.version>
@@ -224,7 +224,7 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
- <artifactId>junit-jupiter</artifactId>
+ <artifactId>testcontainers-junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
</dependency>
<dependency>
(httpcomponents-client) 02/03: Upgraded maven-surefire-plugin to the version defined in HC Parent
Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ok2c pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit 6681f287ddbce87d7db0afb6bca6e4338603a7e1
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Sat Oct 10 14:54:15 2026 +0200
Upgraded maven-surefire-plugin to the version defined in HC Parent
---
pom.xml | 5 -----
1 file changed, 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4fbf48e38..a4351f75f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -450,11 +450,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <!-- Several features such as group exclusion and parallel test execution
- in the integration test suite do not appear to work reliably with
- versions of maven-surefire-plugin higher than 3.5.0
- -->
- <version>3.5.0</version>
<configuration>
<excludedGroups>slow,time-out,stale-conn</excludedGroups>
</configuration>