use of com.adaptris.interlok.config.DataOutputParameter in project interlok by adaptris.
the class ExceptionAsStringReportTest method testDoService_Payload_Exception.
@Test
public void testDoService_Payload_Exception() throws Exception {
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
msg.addObjectHeader(CoreConstants.OBJ_METADATA_EXCEPTION, new Exception("This is the exception"));
ExceptionReportService service = new ExceptionReportService(new ExceptionAsString().withTarget(new DataOutputParameter<String>() {
@Override
public void insert(String data, InterlokMessage msg) throws InterlokException {
throw new CoreException();
}
}));
try {
execute(service, msg);
fail();
} catch (ServiceException expected) {
}
}
Aggregations