IfStrategy extends AbstractTagStrategy { public void execute(final VoiceXmlInterpreterContext context, final VoiceXmlInterpreter interpreter, final FormInterpretationAlgorithm fia, final FormItem item, final VoiceXmlNode node) throws JVoiceXMLEvent { final NodeList list = getListToExecute(context, node); if (list == null) { LOGGER.info("no condition evaluated to true"); return; } final TagStrategyExecutor executor = fia.getTagStrategyExecutor(); executor.executeChildNodes(context, interpreter, fia, item, list); } IfStrategy(); Collection<String> getEvalAttributes(); void execute(final VoiceXmlInterpreterContext context,
            final VoiceXmlInterpreter interpreter,
            final FormInterpretationAlgorithm fia, final FormItem item,
            final VoiceXmlNode node);  }
@Test public void testExecute() throws Exception, JVoiceXMLEvent { final Block block = createBlock(); final If ifNode = block.appendChild(If.class); ifNode.setCond("test == 'horst'"); final Assign assign = ifNode.appendChild(Assign.class); assign.setName("test"); assign.setExpr("'fritz'"); final TagStrategyFactory tagfactory = Mockito .mock(TagStrategyFactory.class); final Profile profile = getContext().getProfile(); Mockito.when(profile.getTagStrategyFactory()).thenReturn(tagfactory); final DataModel model = getDataModel(); Mockito.when(model.evaluateExpression(ifNode.getCond(), Boolean.class)) .thenReturn(true); final IfStrategy strategy = new IfStrategy(); executeTagStrategy(ifNode, strategy); Mockito.verify(model).evaluateExpression(ifNode.getCond(), Boolean.class); }