Skip to content

Commit c047e5a

Browse files
szetszwoMikaelSmith
authored andcommitted
CDPD-89903. HDFS-17841. TestWebHDFSTimeouts fail with JDK17. (apache#7996)
(cherry picked from commit 01c9d4b)
1 parent 0f236fb commit c047e5a

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
@@ -330,9 +330,8 @@ public static void assertExceptionContains(String expectedText,
330330
if (msg == null) {
331331
throw new AssertionError(E_NULL_THROWABLE_STRING, t);
332332
}
333-
if (expectedText != null && !msg.contains(expectedText)) {
334-
String prefix = org.apache.commons.lang3.StringUtils.isEmpty(message)
335-
? "" : (message + ": ");
333+
if (expectedText != null && !msg.toLowerCase().contains(expectedText.toLowerCase())) {
334+
final String prefix = message == null || message.isEmpty() ? "" : message + ": ";
336335
throw new AssertionError(
337336
String.format("%s Expected to find '%s' %s: %s",
338337
prefix, expectedText, E_UNEXPECTED_EXCEPTION,

0 commit comments

Comments
 (0)