Search in sources :

Example 1 with AlwaysMatchSyntaxIdentifier

use of com.adaptris.core.services.routing.AlwaysMatchSyntaxIdentifier in project interlok by adaptris.

the class IfElseTest method testSyntaxIdentifier.

@Test
public void testSyntaxIdentifier() throws Exception {
    Service mockThen = Mockito.mock(Service.class);
    Service mockElse = Mockito.mock(Service.class);
    IfElse ifElse = new IfElse();
    ifElse.getThen().setService(mockThen);
    ifElse.getOtherwise().setService(mockElse);
    ifElse.setCondition(new AlwaysMatchSyntaxIdentifier());
    try {
        LifecycleHelper.initAndStart(ifElse);
        ifElse.doService(message);
        verify(mockThen, times(1)).doService(message);
        verify(mockElse, times(0)).doService(message);
    } finally {
        LifecycleHelper.stopAndClose(ifElse);
    }
}
Also used : AlwaysMatchSyntaxIdentifier(com.adaptris.core.services.routing.AlwaysMatchSyntaxIdentifier) NullService(com.adaptris.core.NullService) Service(com.adaptris.core.Service) LogMessageService(com.adaptris.core.services.LogMessageService) Test(org.junit.Test)

Aggregations

NullService (com.adaptris.core.NullService)1 Service (com.adaptris.core.Service)1 LogMessageService (com.adaptris.core.services.LogMessageService)1 AlwaysMatchSyntaxIdentifier (com.adaptris.core.services.routing.AlwaysMatchSyntaxIdentifier)1 Test (org.junit.Test)1