Search in sources :

Example 1 with MockStopProcessingService

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);
}
Also used : MockStopProcessingService(com.adaptris.core.stubs.MockStopProcessingService) AddMetadataService(com.adaptris.core.services.metadata.AddMetadataService) Test(org.junit.Test)

Aggregations

AddMetadataService (com.adaptris.core.services.metadata.AddMetadataService)1 MockStopProcessingService (com.adaptris.core.stubs.MockStopProcessingService)1 Test (org.junit.Test)1