@Test public void testExecute_CreateInspectionHook_ExpectUpdate() throws Exception { when(this.sdnApi.installInspectionHook(any(), any(), any(), any(), any(), any())) .thenReturn(INSPECTION_HOOK_ID); SfcFlowClassifierCreateTask createTask = this.task.create(this.sg, this.port); createTask.execute(); verify(this.sdnApi, times(1)).installInspectionHook(argThat(new ElementIdMatcher<NetworkElement>(OPENSTACK_VMPORT_ID)), argThat(new ElementIdMatcher<InspectionPortElement>(OPENSTACK_SFC_ID)), (Long) isNull(), (TagEncapsulationType) isNull(), (Long) isNull(), (FailurePolicyType) isNull()); verify(this.port).setInspectionHookId(INSPECTION_HOOK_ID); }
public SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierCreateTask task = new SfcFlowClassifierCreateTask(); task.securityGroup = securityGroup; task.sfc = securityGroup.getServiceFunctionChain(); task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
SfcFlowClassifierCreateTask extends TransactionalTask { public SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierCreateTask task = new SfcFlowClassifierCreateTask(); task.securityGroup = securityGroup; task.sfc = securityGroup.getServiceFunctionChain(); task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
SfcFlowClassifierCreateTask extends TransactionalTask { public SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierCreateTask task = new SfcFlowClassifierCreateTask(); task.securityGroup = securityGroup; task.sfc = securityGroup.getServiceFunctionChain(); task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
SfcFlowClassifierCreateTask extends TransactionalTask { public SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierCreateTask task = new SfcFlowClassifierCreateTask(); task.securityGroup = securityGroup; task.sfc = securityGroup.getServiceFunctionChain(); task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
SfcFlowClassifierCreateTask extends TransactionalTask { public SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port) { SfcFlowClassifierCreateTask task = new SfcFlowClassifierCreateTask(); task.securityGroup = securityGroup; task.sfc = securityGroup.getServiceFunctionChain(); task.port = port; task.vmName = port.getVm() != null ? port.getVm().getName() : port.getSubnet().getName(); task.apiFactory = this.apiFactory; task.name = task.getName(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }