DefaultExecutor implements ActionStrategy { @Override public void execute(final Intent intent, final FlowAction flowAction) throws IntentInvalidException { if(intent == null) { throw new IntentInvalidException(INTENT_NULL_MESSAGE); } final List<String> endPointGroups = IntentUtils.extractEndPointGroup(intent); Action actionContainer = IntentUtils.getAction(intent); intentFlowManager.setEndPointGroups(endPointGroups); intentFlowManager.setAction(actionContainer); intentFlowManager.setIntent(intent); final Map<Node, List<NodeConnector>> nodeMap = TopologyUtils.getNodes(dataBroker); for (Map.Entry<Node, List<NodeConnector>> entry : nodeMap.entrySet()) { intentFlowManager.pushFlow(entry.getKey().getId(), flowAction); } } DefaultExecutor(final IntentFlowManager intentFlowManager, final DataBroker dataBroker); @Override void execute(final Intent intent, final FlowAction flowAction);  }
@Test (expected = IntentInvalidException.class) public void testShouldThrowsNoSuchElementExceptionWhenExecuteIntent() throws IntentInvalidException { defaultExecutorMock.execute(null, FlowAction.ADD_FLOW); }
@Test public void testExecuteIntentByFlowAction() throws ReadFailedException, IntentInvalidException { defaultExecutorMock.execute(intentMock, FlowAction.ADD_FLOW); }