use of com.adaptris.core.stubs.MockStopProcessingService in project interlok by adaptris.
the class ServiceListTest method testBreakOutOfServiceList.
@Test
public void testBreakOutOfServiceList() throws CoreException {
ServiceList services = createServiceList(false);
services.addService(new MockStopProcessingService());
services.addService(new AddMetadataService(Arrays.asList(new MetadataElement(KEY3, VAL3))));
AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage();
execute(services, msg);
assertTrue(msg.getMetadataValue(KEY1).equals(VAL1));
assertTrue(msg.getMetadataValue(KEY2).equals(VAL2));
// test break out metadata has been set...
assertTrue(msg.getMetadataValue(CoreConstants.STOP_PROCESSING_KEY).equals(CoreConstants.STOP_PROCESSING_VALUE));
// ...and that fourth service has not been applied
assertTrue(msg.getMetadataValue(KEY3) == null);
}
Aggregations