From 3bd3977f9053d9e1d76f8582803518d7e9be592c Mon Sep 17 00:00:00 2001 From: Alejandro Revilla Date: Tue, 15 Aug 2023 21:52:05 -0300 Subject: [PATCH] exception verbiage may change - remove useless check --- .../java/org/jpos/bsh/BSHLogListenerTest.java | 32 +++---------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/jpos/src/test/java/org/jpos/bsh/BSHLogListenerTest.java b/jpos/src/test/java/org/jpos/bsh/BSHLogListenerTest.java index 76456a3810..6682e6b858 100644 --- a/jpos/src/test/java/org/jpos/bsh/BSHLogListenerTest.java +++ b/jpos/src/test/java/org/jpos/bsh/BSHLogListenerTest.java @@ -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 @@ -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 @@ -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 @@ -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