Skip to content

Commit

Permalink
GH-42193: [Java] Update dependency to maintain JUnit 5 only (#42206)
Browse files Browse the repository at this point in the history
### 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: #42193

Authored-by: Hyunseok Seo <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
llama90 authored Jun 21, 2024
1 parent b71e71c commit f07d442
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
package org.apache.arrow.adapter.avro;

import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.math.BigDecimal;
import java.nio.ByteBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package org.apache.arrow.adapter.jdbc.h2;

import static junit.framework.TestCase.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.IOException;
import java.sql.SQLException;
Expand Down
16 changes: 3 additions & 13 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,25 +261,12 @@ under the License.
<version>${dep.junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${dep.junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${dep.junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<!-- Use to keep older tests running -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
Expand Down Expand Up @@ -659,6 +646,9 @@ under the License.
<!-- Do not include annotation processors. Use the annotations-only artifacts -->
<exclude>org.immutables:value</exclude>
<exclude>org.checkerframework:checker</exclude>
<!-- Exclude all JUnit 4 dependencies -->
<exclude>junit:junit:4.*</exclude>
<exclude>org.junit.vintage:junit-vintage-engine</exclude>
</excludes>
</bannedDependencies>
</rules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
package org.apache.arrow.vector.util;

import static junit.framework.TestCase.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Collection;
Expand Down

0 comments on commit f07d442

Please sign in to comment.