Skip to content

Commit

Permalink
exception verbiage may change - remove useless check
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Aug 16, 2023
1 parent 647167e commit 3bd3977
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions jpos/src/test/java/org/jpos/bsh/BSHLogListenerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,7 @@ public void testReplaceThrowsNullPointerException3() throws Throwable {
try {
BSHLogListener.replace(src, patterns, to);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot read field \"value\" because \"tgtStr\" is null", ex.getMessage(), "ex.getMessage()");
}
}
} catch (NullPointerException ex) {}
}

@Test
Expand All @@ -426,13 +420,7 @@ public void testReplaceThrowsNullPointerException4() throws Throwable {
try {
BSHLogListener.replace(src, patterns, to);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot read field \"value\" because \"tgtStr\" is null", ex.getMessage(), "ex.getMessage()");
}
}
} catch (NullPointerException ex) {}
}

@Test
Expand All @@ -445,13 +433,7 @@ public void testReplaceThrowsNullPointerException5() throws Throwable {
try {
BSHLogListener.replace(src, patterns, to);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot read field \"value\" because \"tgtStr\" is null", ex.getMessage(), "ex.getMessage()");
}
}
} catch (NullPointerException ex) {}
}

@Test
Expand All @@ -463,13 +445,7 @@ public void testReplaceThrowsNullPointerException6() throws Throwable {
try {
BSHLogListener.replace(src, patterns, to);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot read field \"value\" because \"tgtStr\" is null", ex.getMessage(), "ex.getMessage()");
}
}
} catch (NullPointerException ex) {}
}

@Test
Expand Down

0 comments on commit 3bd3977

Please sign in to comment.