Skip to content

Commit 01c9d4b

Browse files
authored
HDFS-17841. TestWebHDFSTimeouts fail with JDK17. (#7996)
1 parent cecddfe commit 01c9d4b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/GenericTestUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,8 @@ public static void assertExceptionContains(String expectedText,
334334
if (msg == null) {
335335
throw new AssertionError(E_NULL_THROWABLE_STRING, t);
336336
}
337-
if (expectedText != null && !msg.contains(expectedText)) {
338-
String prefix = org.apache.commons.lang3.StringUtils.isEmpty(message)
339-
? "" : (message + ": ");
337+
if (expectedText != null && !msg.toLowerCase().contains(expectedText.toLowerCase())) {
338+
final String prefix = message == null || message.isEmpty() ? "" : message + ": ";
340339
throw new AssertionError(
341340
String.format("%s Expected to find '%s' %s: %s",
342341
prefix, expectedText, E_UNEXPECTED_EXCEPTION,

0 commit comments

Comments
 (0)