Skip to content

Commit 4af4430

Browse files
committed
fix(test): change exception message
1 parent 34b2d1f commit 4af4430

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

framework/src/test/java/org/tron/core/jsonrpc/JsonrpcServiceTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,12 @@ public void testBlockTagParsing() {
505505
// parseBlockNumber: bad hex -> throws
506506
Exception abcEx = Assert.assertThrows(Exception.class,
507507
() -> parseBlockNumber("abc", wallet));
508-
Assert.assertEquals("Incorrect hex syntax", abcEx.getMessage());
508+
Assert.assertEquals("invalid block number", abcEx.getMessage());
509509

510510
// parseBlockNumber: malformed hex -> throws
511511
Exception hexEx = Assert.assertThrows(Exception.class,
512512
() -> parseBlockNumber("0xxabc", wallet));
513-
// https://bugs.openjdk.org/browse/JDK-8176425, from JDK 12, the exception message is changed
514-
Assert.assertTrue(hexEx.getMessage().startsWith("For input string: \"xabc\""));
513+
Assert.assertEquals("invalid block number", hexEx.getMessage());
515514
}
516515

517516
@Test
@@ -867,7 +866,7 @@ public void testLogFilterWrapper() {
867866
JsonRpcInvalidParamsException.class,
868867
() -> new LogFilterWrapper(new FilterRequest("test", null, null, null, null),
869868
100, null, false));
870-
Assert.assertEquals("Incorrect hex syntax", testSyntaxEx.getMessage());
869+
Assert.assertEquals("invalid block number", testSyntaxEx.getMessage());
871870

872871
// to = 8000
873872
try {

0 commit comments

Comments
 (0)