Skip to content

Commit c7ac68c

Browse files
committed
HDFS-12431. [JDK17] Upgrade JUnit from 4 to 5 in hadoop-hdfs Part4.
1 parent 7c7adef commit c7ac68c

File tree

49 files changed

+1434
-1308
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1434
-1308
lines changed

hadoop-hdfs-project/hadoop-hdfs/pom.xml

-15
Original file line numberDiff line numberDiff line change
@@ -241,26 +241,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
241241
<groupId>org.apache.hadoop</groupId>
242242
<artifactId>hadoop-annotations</artifactId>
243243
</dependency>
244-
<dependency>
245-
<groupId>org.junit.jupiter</groupId>
246-
<artifactId>junit-jupiter-api</artifactId>
247-
<scope>test</scope>
248-
</dependency>
249-
<dependency>
250-
<groupId>org.junit.jupiter</groupId>
251-
<artifactId>junit-jupiter-engine</artifactId>
252-
<scope>test</scope>
253-
</dependency>
254244
<dependency>
255245
<groupId>org.junit.jupiter</groupId>
256246
<artifactId>junit-jupiter-params</artifactId>
257247
<scope>test</scope>
258248
</dependency>
259-
<dependency>
260-
<groupId>org.junit.platform</groupId>
261-
<artifactId>junit-platform-launcher</artifactId>
262-
<scope>test</scope>
263-
</dependency>
264249
</dependencies>
265250

266251
<build>

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestAdminHelper.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
*/
1818
package org.apache.hadoop.hdfs.tools;
1919

20-
import org.junit.Assert;
21-
import org.junit.Test;
20+
import org.junit.jupiter.api.Test;
21+
22+
import static org.junit.jupiter.api.Assertions.assertEquals;
23+
import static org.junit.jupiter.api.Assertions.assertTrue;
2224

2325
/**
2426
* Test class to test Admin Helper.
@@ -28,11 +30,10 @@ public class TestAdminHelper {
2830
@Test
2931
public void prettifyExceptionWithNpe() {
3032
String pretty = AdminHelper.prettifyException(new NullPointerException());
31-
Assert.assertTrue(
33+
assertTrue(pretty.startsWith("NullPointerException at org.apache.hadoop.hdfs.tools"
34+
+ ".TestAdminHelper.prettifyExceptionWithNpe"),
3235
"Prettified exception message doesn't contain the required exception "
33-
+ "message",
34-
pretty.startsWith("NullPointerException at org.apache.hadoop.hdfs.tools"
35-
+ ".TestAdminHelper.prettifyExceptionWithNpe"));
36+
+ "message");
3637
}
3738

3839
@Test
@@ -42,7 +43,7 @@ public void prettifyException() {
4243
new IllegalArgumentException("Something is wrong",
4344
new IllegalArgumentException("Something is illegal")));
4445

45-
Assert.assertEquals(
46+
assertEquals(
4647
"IllegalArgumentException: Something is wrong",
4748
pretty);
4849

0 commit comments

Comments
 (0)