Skip to content

Commit d5a6ddf

Browse files
committed
make asserts that expect IllegalArgumentException less precise
This exception is thrown out of JVM code, and the presence or absence of an error message appears to be implementation specific. Loosen the constrains for this assertion.
1 parent 65065e6 commit d5a6ddf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockHeaderCorruption.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ public void testOnDiskSizeWithoutHeaderCorruptionFirstBlock() throws Exception {
132132
consumer.readFully();
133133
fail();
134134
} catch (Exception e) {
135-
assertThat(e, new IsThrowableMatching().withInstanceOf(IllegalArgumentException.class)
136-
.withMessage(startsWith("newLimit > capacity")));
135+
assertThat(e, new IsThrowableMatching().withInstanceOf(IllegalArgumentException.class));
137136
}
138137
assertEquals(0, consumer.getItemsRead());
139138
}
@@ -203,8 +202,7 @@ public void testOnDiskSizeWithoutHeaderCorruptionSecondBlock() throws Exception
203202
consumer.readFully();
204203
fail();
205204
} catch (Exception e) {
206-
assertThat(e, new IsThrowableMatching().withInstanceOf(IllegalArgumentException.class)
207-
.withMessage(startsWith("newLimit > capacity")));
205+
assertThat(e, new IsThrowableMatching().withInstanceOf(IllegalArgumentException.class));
208206
}
209207
assertEquals(1, consumer.getItemsRead());
210208
}

0 commit comments

Comments
 (0)