@Test public void testExecute_WhenInspectionPortIsRemoved_DAIIsDeleted() throws Exception { DistributedApplianceInstance dai = createAndRegisterDAI(); DeleteK8sDAIInspectionPortTask task = this.factory.create(dai); when(this.apiFactoryServiceMock.createNetworkRedirectionApi(dai.getVirtualSystem())).thenReturn(this.redirectionApi); task.execute(); verify(this.redirectionApi, times(1)) .removeInspectionPort(argThat(new InspectionPortElementMatcher(dai.getInspectionElementId(), dai.getInspectionElementParentId()))); verify(this.em, times(1)).remove(dai); }
public DeleteK8sDAIInspectionPortTask create(DistributedApplianceInstance dai) { DeleteK8sDAIInspectionPortTask task = new DeleteK8sDAIInspectionPortTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.apiFactoryService = this.apiFactoryService; task.dai = dai; return task; }
DeleteK8sDAIInspectionPortTask extends TransactionalTask { public DeleteK8sDAIInspectionPortTask create(DistributedApplianceInstance dai) { DeleteK8sDAIInspectionPortTask task = new DeleteK8sDAIInspectionPortTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.apiFactoryService = this.apiFactoryService; task.dai = dai; return task; } }
DeleteK8sDAIInspectionPortTask extends TransactionalTask { public DeleteK8sDAIInspectionPortTask create(DistributedApplianceInstance dai) { DeleteK8sDAIInspectionPortTask task = new DeleteK8sDAIInspectionPortTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.apiFactoryService = this.apiFactoryService; task.dai = dai; return task; }  }
DeleteK8sDAIInspectionPortTask extends TransactionalTask { public DeleteK8sDAIInspectionPortTask create(DistributedApplianceInstance dai) { DeleteK8sDAIInspectionPortTask task = new DeleteK8sDAIInspectionPortTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.apiFactoryService = this.apiFactoryService; task.dai = dai; return task; }  DeleteK8sDAIInspectionPortTask create(DistributedApplianceInstance dai); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
DeleteK8sDAIInspectionPortTask extends TransactionalTask { public DeleteK8sDAIInspectionPortTask create(DistributedApplianceInstance dai) { DeleteK8sDAIInspectionPortTask task = new DeleteK8sDAIInspectionPortTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.apiFactoryService = this.apiFactoryService; task.dai = dai; return task; }  DeleteK8sDAIInspectionPortTask create(DistributedApplianceInstance dai); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }