use of org.jpos.iso.packager.PostPackager in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException10.
@Test
public void testFilterThrowsNullPointerException10() throws Throwable {
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setSpace((Space) null);
statefulFilter.setMatchDirection(0);
statefulFilter.setSavedFields(null);
statefulFilter.setIgnoredFields(null);
try {
statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100, new PostPackager()), new ISOMsg("testStatefulFilterMti"), new LogEvent());
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"org.jpos.space.Space.out(Object, Object, long)\" because the return value of \"org.jpos.iso.filter.StatefulFilter.getSpace()\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
Aggregations