use of org.jpos.iso.packager.GenericPackager in project jPOS by jpos.
the class StatefulFilterTest method testFilterThrowsNullPointerException3.
@Test
public void testFilterThrowsNullPointerException3() throws Throwable {
int[] key = new int[0];
StatefulFilter statefulFilter = new StatefulFilter();
statefulFilter.setKey(key);
statefulFilter.setSpace((Space) null);
try {
statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100, new GenericPackager()), new ISOMsg("testStatefulFilterMti"), new LogEvent("testStatefulFilterTag", "testString"));
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.inp(Object)\" because the return value of \"org.jpos.iso.filter.StatefulFilter.getSpace()\" is null", ex.getMessage(), "ex.getMessage()");
}
}
}
Aggregations