@Test public void testExecute_CreateInspectionHook_ExpectFailure() throws Exception { doThrow(new Exception()).when(this.sdnApi).installInspectionHook(any(), any(), any(), any(), any(), any()); this.exception.expect(Exception.class); SfcFlowClassifierCreateTask createTask = this.task.create(this.sg, this.port); createTask.execute(); verify(this.port, times(0)).setInspectionHookId(any()); }
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();  }