ExceptionHandlingServiceWrapper extends ServiceImp implements EventHandlerAware, ServiceWrapper { public void setService(Service s) { service = Args.notNull(s, "service"); } ExceptionHandlingServiceWrapper(); @Override void registerEventHandler(EventHandler eh); @Override void doService(AdaptrisMessage msg); @Override void start(); @Override void stop(); Service getService(); void setService(Service s); Service getExceptionHandlingService(); void setExceptionHandlingService(Service s); String getExceptionMessageMetadataKey(); void setExceptionMessageMetadataKey(String s); @Override void prepare(); @Override Service[] wrappedServices(); static final String DEFAULT_EXCEPTION_MESSAGE_METADATA_KEY; }
@Test public void testNoExceptionFromWrappedServices() throws Exception { AddMetadataService s1 = new AddMetadataService(); s1.addMetadataElement("servicesComplete", "true"); ExceptionHandlingServiceWrapper service = create(); service.setService(s1); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage(); execute(service, msg); assertEquals("true", msg.getMetadataValue("servicesComplete")); assertNull(msg.getMetadataValue("exceptionServiceTriggered")); }