Skip to content

Commit f07d442

Browse files
authored
apacheGH-42193: [Java] Update dependency to maintain JUnit 5 only (apache#42206)
### Rationale for this change We have completed migrating all unit test code from JUnit 4 to JUnit 5 for all Java modules. Now, we are removing the compatibility library `junit-vintage-engine` to maintain JUnit 5 only. ### What changes are included in this PR? - Removing JUnit 4 dependencies - Updating remaining `junit.framework.TestCase` imports - Updating excludes to prevent JUnit 4 dependencies ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: apache#42193 Authored-by: Hyunseok Seo <[email protected]> Signed-off-by: David Li <[email protected]>
1 parent b71e71c commit f07d442

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

java/adapter/avro/src/test/java/org/apache/arrow/adapter/avro/AvroLogicalTypesTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717
package org.apache.arrow.adapter.avro;
1818

19-
import static junit.framework.TestCase.assertNull;
20-
import static junit.framework.TestCase.assertTrue;
19+
import static org.junit.jupiter.api.Assertions.assertNull;
2120
import static org.junit.jupiter.api.Assertions.assertThrows;
21+
import static org.junit.jupiter.api.Assertions.assertTrue;
2222

2323
import java.math.BigDecimal;
2424
import java.nio.ByteBuffer;

java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/h2/JdbcToArrowOptionalColumnsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
*/
1717
package org.apache.arrow.adapter.jdbc.h2;
1818

19-
import static junit.framework.TestCase.assertTrue;
2019
import static org.junit.jupiter.api.Assertions.assertFalse;
20+
import static org.junit.jupiter.api.Assertions.assertTrue;
2121

2222
import java.io.IOException;
2323
import java.sql.SQLException;

java/pom.xml

+3-13
Original file line numberDiff line numberDiff line change
@@ -261,25 +261,12 @@ under the License.
261261
<version>${dep.junit.jupiter.version}</version>
262262
<scope>test</scope>
263263
</dependency>
264-
<dependency>
265-
<groupId>org.junit.vintage</groupId>
266-
<artifactId>junit-vintage-engine</artifactId>
267-
<version>${dep.junit.jupiter.version}</version>
268-
<scope>test</scope>
269-
</dependency>
270264
<dependency>
271265
<groupId>org.junit.jupiter</groupId>
272266
<artifactId>junit-jupiter-params</artifactId>
273267
<version>${dep.junit.jupiter.version}</version>
274268
<scope>test</scope>
275269
</dependency>
276-
<!-- Use to keep older tests running -->
277-
<dependency>
278-
<groupId>junit</groupId>
279-
<artifactId>junit</artifactId>
280-
<version>4.13.2</version>
281-
<scope>test</scope>
282-
</dependency>
283270
<dependency>
284271
<groupId>org.mockito</groupId>
285272
<artifactId>mockito-junit-jupiter</artifactId>
@@ -659,6 +646,9 @@ under the License.
659646
<!-- Do not include annotation processors. Use the annotations-only artifacts -->
660647
<exclude>org.immutables:value</exclude>
661648
<exclude>org.checkerframework:checker</exclude>
649+
<!-- Exclude all JUnit 4 dependencies -->
650+
<exclude>junit:junit:4.*</exclude>
651+
<exclude>org.junit.vintage:junit-vintage-engine</exclude>
662652
</excludes>
663653
</bannedDependencies>
664654
</rules>

java/vector/src/test/java/org/apache/arrow/vector/util/TestMapWithOrdinal.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
*/
1717
package org.apache.arrow.vector.util;
1818

19-
import static junit.framework.TestCase.assertNull;
2019
import static org.junit.jupiter.api.Assertions.assertEquals;
2120
import static org.junit.jupiter.api.Assertions.assertFalse;
21+
import static org.junit.jupiter.api.Assertions.assertNull;
2222
import static org.junit.jupiter.api.Assertions.assertTrue;
2323

2424
import java.util.Collection;

0 commit comments

Comments
 (0)