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);
}
}
Aggregations