Skip to content

Commit 5fe19e5

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

File tree

49 files changed

+1435
-1294
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

+1435
-1294
lines changed

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)