RegexpService extends ServiceImp { public List<Execution> getExecutions() { return executions; } RegexpService(); void doService(AdaptrisMessage msg); @Override void prepare(); DataInputParameter<String> getRegexpSource(); void setRegexpSource(DataInputParameter<String> src); List<Execution> getExecutions(); void setExecutions(List<Execution> list);  }
@Test public void testService_Exception() throws Exception { AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(ALTERNATE_PAYLOAD); RegexpService s = new RegexpService(); s.getExecutions().add(new Execution(new DodgyInputParameter(), new MetadataDataOutputParameter(TARGET_METADATA_KEY))); try { execute(s, msg); fail(); } catch (ServiceException expected) { } }