From a96317e3537abff1d5759356ee27fc1044740f44 Mon Sep 17 00:00:00 2001 From: ZhangJian He Date: Wed, 1 Mar 2023 09:54:01 +0800 Subject: [PATCH] Update testcontainers to last version to support m1 (#3819) --- .../bookkeeper/metadata/etcd/helpers/KeySetReaderTest.java | 2 +- .../bookkeeper/metadata/etcd/testing/EtcdContainer.java | 4 ++-- pom.xml | 2 +- .../apache/bookkeeper/tests/containers/BookieContainer.java | 2 +- .../org/apache/bookkeeper/tests/containers/ZKContainer.java | 2 +- .../bookkeeper/tests/containers/wait/HttpWaitStrategy.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/helpers/KeySetReaderTest.java b/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/helpers/KeySetReaderTest.java index ad1084f066b..b4bdf6ea79b 100644 --- a/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/helpers/KeySetReaderTest.java +++ b/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/helpers/KeySetReaderTest.java @@ -41,7 +41,7 @@ import org.apache.bookkeeper.versioning.Versioned; import org.apache.commons.compress.utils.Sets; import org.junit.Test; -import org.testcontainers.shaded.org.apache.commons.lang.RandomStringUtils; +import org.testcontainers.shaded.org.apache.commons.lang3.RandomStringUtils; /** * Integration test {@link KeySetReader}. diff --git a/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdContainer.java b/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdContainer.java index 2ef547d1f33..0178e4d2ab5 100644 --- a/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdContainer.java +++ b/metadata-drivers/etcd/src/test/java/org/apache/bookkeeper/metadata/etcd/testing/EtcdContainer.java @@ -59,7 +59,7 @@ public EtcdContainer(String clusterName) { } public String getExternalServiceUri() { - return "etcd://" + getContainerIpAddress() + ":" + getEtcdClientPort() + "/clusters/" + clusterName; + return "etcd://" + getHost() + ":" + getEtcdClientPort() + "/clusters/" + clusterName; } public String getInternalServiceUri() { @@ -113,7 +113,7 @@ public int getEtcdClientPort() { } public String getClientEndpoint() { - return String.format("http://%s:%d", getContainerIpAddress(), getEtcdClientPort()); + return String.format("http://%s:%d", getHost(), getEtcdClientPort()); } private WaitStrategy waitStrategy() { diff --git a/pom.xml b/pom.xml index a46ffaeaf88..8efb42dcdd5 100644 --- a/pom.xml +++ b/pom.xml @@ -171,7 +171,7 @@ 1.33 4.6.0 1.3.2 - 1.15.1 + 1.17.6 4.3.8 3.8.1 1.1.7.7 diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java index 9e430e0fa00..4ba5c987ba0 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java @@ -61,7 +61,7 @@ public String getContainerName() { } public String getExternalGrpcEndpointStr() { - return getContainerIpAddress() + ":" + getMappedPort(BOOKIE_GRPC_PORT); + return getHost() + ":" + getMappedPort(BOOKIE_GRPC_PORT); } public String getInternalGrpcEndpointStr() { diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java index c417b031998..08767fec829 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java @@ -43,7 +43,7 @@ public ZKContainer(String clusterName) { @Override public String getExternalServiceUri() { - return "zk://" + getContainerIpAddress() + ":" + getMappedPort(ZK_PORT) + "/ledgers"; + return "zk://" + getHost() + ":" + getMappedPort(ZK_PORT) + "/ledgers"; } @Override diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java index f41fb3870a3..fbbf7c5e955 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java @@ -174,7 +174,7 @@ protected void waitUntilReady() { */ private URI buildLivenessUri(int livenessCheckPort) { final String scheme = (tlsEnabled ? "https" : "http") + "://"; - final String host = waitStrategyTarget.getContainerIpAddress(); + final String host = waitStrategyTarget.getHost(); final String portSuffix; if ((tlsEnabled && 443 == livenessCheckPort) || (!tlsEnabled && 80 == livenessCheckPort)) { portSuffix = "";