IntentAddShellCommand extends OsgiCommandSupport { protected List<Actions> createActions() throws InvalidObjectException { List<Actions> actionsList = new ArrayList<Actions>(); short order = 1; for (String intentAction : this.actions) { org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.Action action = null; if (intentAction.equalsIgnoreCase(NicProvider.ACTION_ALLOW)) { action = new org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.action .AllowBuilder().setAllow(new AllowBuilder().build()).build(); } else if (intentAction.equalsIgnoreCase(NicProvider.ACTION_BLOCK)) { action = new org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.action .BlockBuilder().setBlock(new BlockBuilder().build()).build(); } else if (intentAction.equalsIgnoreCase(NicProvider.ACTION_LOG)) { action = new org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.action .LogBuilder().setLog(new LogBuilder().build()).build(); } else if (intentAction.equalsIgnoreCase(NicProvider.ACTION_REDIRECT)) { Redirect actionRedirect = new org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.action .RedirectBuilder().setRedirect(new RedirectBuilder().setServiceName(serviceName).build()).build(); action = actionRedirect; } else { LOG.error("No action found with: " + intentAction + " in this release"); return null; } Actions intentActions = new ActionsBuilder().setOrder(order).setAction(action).build(); actionsList.add(intentActions); order++; } return actionsList; } IntentAddShellCommand(NicConsoleProvider provider, IntentMappingService mappingService);   }
@Test public final void testCreateActions() throws InvalidObjectException { List<Actions> actions = nicAddShellCmd.createActions(); assertNotNull(actions); assertEquals("by default at least 1 action should be created", true, actions.size() > 0); }