MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration(new Properties()));
int[] fields = new int[3];
fields[1] = 57;
mD5Filter.setFields(fields);
ISOMsg m = new ISOMsg("testMD5FilterMti");
LogEvent evt = new LogEvent("testMD5FilterTag", new XMLPackager());
try {
mD5Filter.filter(new ASCIIChannel(null), m, evt);
fail("Expected VetoException to be thrown");
} catch (ISOFilter.VetoException ex) {
assertEquals("evt.payLoad.size()", 4, evt.getPayLoad().size());
assertEquals("ex.getMessage()", "org.jpos.iso.ISOFilter$VetoException: invalid MAC", ex.getMessage());
assertEquals("ex.getNested().getMessage()", "invalid MAC", ex.getNested().getMessage());
assertEquals("m.getDirection()", 0, m.getDirection());
}
}