@Test public void testExecute_WithSecurityGroupSFCIdSetToNotEmpty_ExpectUpdate() throws Exception { this.sg.setNetworkElementId("OLD_SFC_ID"); UpdateServiceFunctionChainTask updateTask = this.task.create(this.sg, this.networkElementList); Mockito.when(this.sdnApi .updateNetworkElement(argThat(new ElementIdMatcher<NetworkElement>(this.sg.getNetworkElementId())), any())) .thenReturn(new NetworkElementImpl("UPDATED_SFC_ID")); updateTask.execute(); assertEquals(this.sg.getNetworkElementId(), "UPDATED_SFC_ID"); }
public UpdateServiceFunctionChainTask create(SecurityGroup securityGroup, List<NetworkElement> updatedPortPairGroups) { UpdateServiceFunctionChainTask task = new UpdateServiceFunctionChainTask(); task.sfc = securityGroup.getServiceFunctionChain(); task.securityGroup = securityGroup; task.updatedPortPairGroups = updatedPortPairGroups; task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
UpdateServiceFunctionChainTask extends TransactionalTask { public UpdateServiceFunctionChainTask create(SecurityGroup securityGroup, List<NetworkElement> updatedPortPairGroups) { UpdateServiceFunctionChainTask task = new UpdateServiceFunctionChainTask(); task.sfc = securityGroup.getServiceFunctionChain(); task.securityGroup = securityGroup; task.updatedPortPairGroups = updatedPortPairGroups; task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
UpdateServiceFunctionChainTask extends TransactionalTask { public UpdateServiceFunctionChainTask create(SecurityGroup securityGroup, List<NetworkElement> updatedPortPairGroups) { UpdateServiceFunctionChainTask task = new UpdateServiceFunctionChainTask(); task.sfc = securityGroup.getServiceFunctionChain(); task.securityGroup = securityGroup; task.updatedPortPairGroups = updatedPortPairGroups; task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
UpdateServiceFunctionChainTask extends TransactionalTask { public UpdateServiceFunctionChainTask create(SecurityGroup securityGroup, List<NetworkElement> updatedPortPairGroups) { UpdateServiceFunctionChainTask task = new UpdateServiceFunctionChainTask(); task.sfc = securityGroup.getServiceFunctionChain(); task.securityGroup = securityGroup; task.updatedPortPairGroups = updatedPortPairGroups; task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  UpdateServiceFunctionChainTask create(SecurityGroup securityGroup,
            List<NetworkElement> updatedPortPairGroups); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
UpdateServiceFunctionChainTask extends TransactionalTask { public UpdateServiceFunctionChainTask create(SecurityGroup securityGroup, List<NetworkElement> updatedPortPairGroups) { UpdateServiceFunctionChainTask task = new UpdateServiceFunctionChainTask(); task.sfc = securityGroup.getServiceFunctionChain(); task.securityGroup = securityGroup; task.updatedPortPairGroups = updatedPortPairGroups; task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  UpdateServiceFunctionChainTask create(SecurityGroup securityGroup,
            List<NetworkElement> updatedPortPairGroups); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }