use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class MSGTEST1Test method testValidateThrowsISOVException1.
@Test
public void testValidateThrowsISOVException1() throws Throwable {
ISOComponent m = new ISOVMsg(new ISOMsg());
try {
new MSGTEST(true).validate(m);
fail("Expected ISOVException to be thrown");
} catch (ISOVException ex) {
assertEquals("ex.getMessage()", "Error on msg. ", ex.getMessage());
assertFalse("ex.treated", ex.treated);
assertSame("ex.errComponent", m, ex.errComponent);
assertNull("ex.getNested()", ex.getNested());
}
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class MSGTEST1Test method testValidate.
@Test
public void testValidate() throws Throwable {
MSGTEST mSGTEST = new MSGTEST();
final ISOVMsg m = mock(ISOVMsg.class);
given(m.getComposite()).willReturn(m);
given(m.hasFields(new int[] { 3, 7, 11 })).willReturn(false);
given(m.addISOVError(isA(ISOVError.class))).willReturn(true);
ISOVMsg result = (ISOVMsg) mSGTEST.validate(m);
assertSame("result", m, result);
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class MSGTEST1Test method testValidate1.
@Test
public void testValidate1() throws Throwable {
ISOVMsg result = (ISOVMsg) new MSGTEST().validate(new ISOMsg("testMSGTESTMti"));
assertNotNull("result", result);
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class VErrorParserTest method testGetVErrorsThrowsNullPointerException1.
@Test
public void testGetVErrorsThrowsNullPointerException1() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
try {
vErrorParser.getVErrors(new ISOVMsg(new ISOMsg(), null));
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.ISOVMsg in project jPOS by jpos.
the class VErrorParserTest method testGetVErrorsThrowsNullPointerException.
@Test
public void testGetVErrorsThrowsNullPointerException() throws Throwable {
VErrorParser vErrorParser = new VErrorParser();
ISOVMsg c = new ISOVMsg(new ISOMsg(), new ISOVError("testVErrorParserDescription"));
c.addISOVError(null);
try {
vErrorParser.getVErrors(c);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations