This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new 679954a  [SPARK-53712] Fix `spark-operator` to use `JUnit 5` instead 
of `JUnit 4`
679954a is described below

commit 679954ae27a3a352ae44e1eb8a977e324703e395
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Wed Sep 24 23:56:34 2025 -0700

    [SPARK-53712] Fix `spark-operator` to use `JUnit 5` instead of `JUnit 4`
    
    ### What changes were proposed in this pull request?
    
    This PR aims to fix `spark-operator` module to use `JUnit 5` correctly 
instead of the transitive `JUnit 4` dependency.
    
    ### Why are the changes needed?
    
    `Apache Spark K8s Operator` should use `JUnit 5` consistently.
    
    
https://github.com/apache/spark-kubernetes-operator/blob/a0929a4023f7a0f9eba5765fdb47e17228d68a0e/gradle/libs.versions.toml#L26
    
    **BEFORE**
    
    ```
    $ gradle :spark-operator:dependencies | grep ' junit:junit' | wc -l
           3
    ```
    
    **AFTER**
    
    ```
    $ gradle :spark-operator:dependencies | grep ' junit:junit' | wc -l
           0
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, this is a test code and dependency change.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #344 from dongjoon-hyun/SPARK-53712.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 spark-operator/build.gradle                                           | 4 +++-
 .../apache/spark/k8s/operator/metrics/MetricsSystemFactoryTest.java   | 2 +-
 .../k8s/operator/metrics/source/KubernetesMetricsInterceptorTest.java | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/spark-operator/build.gradle b/spark-operator/build.gradle
index 57f6d42..27f0b26 100644
--- a/spark-operator/build.gradle
+++ b/spark-operator/build.gradle
@@ -65,7 +65,9 @@ dependencies {
     exclude group: "org.apache.logging.log4j"
     exclude group: "org.slf4j"
   }
-  testImplementation(libs.mockwebserver)
+  testImplementation(libs.mockwebserver) {
+    exclude group: 'junit'
+  }
   testImplementation platform(libs.junit.bom)
   testImplementation(libs.junit.jupiter)
   testRuntimeOnly(libs.junit.platform.launcher)
diff --git 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/MetricsSystemFactoryTest.java
 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/MetricsSystemFactoryTest.java
index a9a341b..b0efcc9 100644
--- 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/MetricsSystemFactoryTest.java
+++ 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/MetricsSystemFactoryTest.java
@@ -20,7 +20,7 @@
 package org.apache.spark.k8s.operator.metrics;
 
 import static 
org.apache.spark.k8s.operator.metrics.MetricsSystemFactory.parseSinkProperties;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Properties;
 
diff --git 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/source/KubernetesMetricsInterceptorTest.java
 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/source/KubernetesMetricsInterceptorTest.java
index 54d5214..51efcc2 100644
--- 
a/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/source/KubernetesMetricsInterceptorTest.java
+++ 
b/spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/source/KubernetesMetricsInterceptorTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.spark.k8s.operator.metrics.source;
 
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Arrays;
 import java.util.Collections;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to