This is an automated email from the ASF dual-hosted git repository.
gyfora pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 955d2be5 [hotfix][test] Finalize JUnit 5 migration and prune unused
test dependencies (#1119)
955d2be5 is described below
commit 955d2be57aa7dd158b309c662d6e9abdaf0236e8
Author: Purushottam Sinha <[email protected]>
AuthorDate: Thu Jun 4 14:54:09 2026 +0530
[hotfix][test] Finalize JUnit 5 migration and prune unused test
dependencies (#1119)
---
flink-autoscaler-plugin-jdbc/pom.xml | 22 ++++++++++++++++++++++
flink-autoscaler/pom.xml | 10 ++++++++++
flink-kubernetes-operator/pom.xml | 7 -------
.../operator/utils/FlinkUtilsZookeeperHATest.java | 12 ++++++------
flink-kubernetes-webhook/pom.xml | 7 -------
5 files changed, 38 insertions(+), 20 deletions(-)
diff --git a/flink-autoscaler-plugin-jdbc/pom.xml
b/flink-autoscaler-plugin-jdbc/pom.xml
index 4e132e12..5e2e276b 100644
--- a/flink-autoscaler-plugin-jdbc/pom.xml
+++ b/flink-autoscaler-plugin-jdbc/pom.xml
@@ -106,9 +106,31 @@ under the License.
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
+ <exclusion>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
</exclusions>
</dependency>
+ <!--
+ Testcontainers 1.x container types implement
org.junit.rules.TestRule, so JUnit 4
+ must stay on the test compile classpath even though all tests use
JUnit 5. The unused
+ junit-vintage-engine is excluded above; only the junit:junit core
jar is pulled in here.
+ TODO: remove this once Testcontainers is upgraded to a version
without the JUnit 4
+ TestRule coupling (tracked in a follow-up JIRA).
+ -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13.2</version>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
diff --git a/flink-autoscaler/pom.xml b/flink-autoscaler/pom.xml
index b939a2d8..3e96f325 100644
--- a/flink-autoscaler/pom.xml
+++ b/flink-autoscaler/pom.xml
@@ -88,6 +88,16 @@ under the License.
<artifactId>flink-test-utils-junit</artifactId>
<version>${flink.version}</version>
<scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
diff --git a/flink-kubernetes-operator/pom.xml
b/flink-kubernetes-operator/pom.xml
index 5a6240d5..9769dcc7 100644
--- a/flink-kubernetes-operator/pom.xml
+++ b/flink-kubernetes-operator/pom.xml
@@ -207,13 +207,6 @@ under the License.
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>mockwebserver</artifactId>
- <version>${okhttp.version}</version>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils</artifactId>
diff --git
a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsZookeeperHATest.java
b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsZookeeperHATest.java
index 4a580c15..ec761273 100644
---
a/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsZookeeperHATest.java
+++
b/flink-kubernetes-operator/src/test/java/org/apache/flink/kubernetes/operator/utils/FlinkUtilsZookeeperHATest.java
@@ -35,8 +35,9 @@ import org.apache.curator.test.TestingServer;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.io.TempDir;
+import java.nio.file.Path;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -50,7 +51,9 @@ public class FlinkUtilsZookeeperHATest {
Configuration configuration;
TestingServer testingServer;
- TemporaryFolder temporaryFolder;
+
+ @TempDir Path temporaryFolder;
+
CuratorFramework curator;
JobID jobID = JobID.generate();
@@ -69,11 +72,9 @@ public class FlinkUtilsZookeeperHATest {
HighAvailabilityOptions.HA_MODE,
HighAvailabilityMode.ZOOKEEPER.toString());
configuration.setString(
HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM,
testingServer.getConnectString());
- temporaryFolder = new TemporaryFolder();
- temporaryFolder.create();
configuration.setString(
HighAvailabilityOptions.HA_STORAGE_PATH,
- temporaryFolder.newFolder().getAbsolutePath());
+ temporaryFolder.resolve("ha").toAbsolutePath().toString());
// Create the Curator
curator = getTestCurator(configuration).asCuratorFramework();
@@ -95,7 +96,6 @@ public class FlinkUtilsZookeeperHATest {
public void cleanupZookeeper() throws Exception {
curator.close();
testingServer.close();
- temporaryFolder.delete();
}
@Test
diff --git a/flink-kubernetes-webhook/pom.xml b/flink-kubernetes-webhook/pom.xml
index 8eef7efd..dd545a81 100644
--- a/flink-kubernetes-webhook/pom.xml
+++ b/flink-kubernetes-webhook/pom.xml
@@ -81,13 +81,6 @@ under the License.
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.squareup.okhttp3</groupId>
- <artifactId>mockwebserver</artifactId>
- <version>${okhttp.version}</version>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>