Skip to content

Commit 679954a

Browse files
committed
[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 apache#344 from dongjoon-hyun/SPARK-53712. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent a0929a4 commit 679954a

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

spark-operator/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ dependencies {
6565
exclude group: "org.apache.logging.log4j"
6666
exclude group: "org.slf4j"
6767
}
68-
testImplementation(libs.mockwebserver)
68+
testImplementation(libs.mockwebserver) {
69+
exclude group: 'junit'
70+
}
6971
testImplementation platform(libs.junit.bom)
7072
testImplementation(libs.junit.jupiter)
7173
testRuntimeOnly(libs.junit.platform.launcher)

spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/MetricsSystemFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
package org.apache.spark.k8s.operator.metrics;
2121

2222
import static org.apache.spark.k8s.operator.metrics.MetricsSystemFactory.parseSinkProperties;
23-
import static org.junit.Assert.assertThrows;
23+
import static org.junit.jupiter.api.Assertions.assertThrows;
2424

2525
import java.util.Properties;
2626

spark-operator/src/test/java/org/apache/spark/k8s/operator/metrics/source/KubernetesMetricsInterceptorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
package org.apache.spark.k8s.operator.metrics.source;
2121

22-
import static org.junit.Assert.assertThrows;
22+
import static org.junit.jupiter.api.Assertions.assertThrows;
2323

2424
import java.util.Arrays;
2525
import java.util.Collections;

0 commit comments

Comments
 (0)