Skip to content

Commit 5eb8500

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

File tree

52 files changed

+1425
-1302
lines changed

Some content is hidden

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

52 files changed

+1425
-1302
lines changed

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
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.Assertions;
21+
import org.junit.jupiter.api.Test;
2222

2323
/**
2424
* Test class to test Admin Helper.
@@ -28,11 +28,10 @@ public class TestAdminHelper {
2828
@Test
2929
public void prettifyExceptionWithNpe() {
3030
String pretty = AdminHelper.prettifyException(new NullPointerException());
31-
Assert.assertTrue(
31+
Assertions.assertTrue(pretty.startsWith("NullPointerException at org.apache.hadoop.hdfs.tools"
32+
+ ".TestAdminHelper.prettifyExceptionWithNpe"),
3233
"Prettified exception message doesn't contain the required exception "
33-
+ "message",
34-
pretty.startsWith("NullPointerException at org.apache.hadoop.hdfs.tools"
35-
+ ".TestAdminHelper.prettifyExceptionWithNpe"));
34+
+ "message");
3635
}
3736

3837
@Test
@@ -42,7 +41,7 @@ public void prettifyException() {
4241
new IllegalArgumentException("Something is wrong",
4342
new IllegalArgumentException("Something is illegal")));
4443

45-
Assert.assertEquals(
44+
Assertions.assertEquals(
4645
"IllegalArgumentException: Something is wrong",
4746
pretty);
4847

0 commit comments

Comments
 (0)