@Test public void testExecute_WhenRemoveInspectionHookSucceeds_SGINetworkElementSetToNull() throws Exception { SecurityGroupInterface sgi = registerNewSGI(4L); SdnRedirectionApi redirectionApi = mockRemoveInspectionHook(sgi, null); registerNetworkRedirectionApi(redirectionApi, sgi.getVirtualSystem()); RemovePortGroupHookTask task = this.factory.create(sgi); task.execute(); Assert.assertNull("The SGI network element id should be null", sgi.getNetworkElementId()); verify(this.em, times(1)).merge(sgi); }
public RemovePortGroupHookTask create(SecurityGroupInterface sgi){ RemovePortGroupHookTask task = new RemovePortGroupHookTask(); task.sgi = sgi; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
RemovePortGroupHookTask extends TransactionalTask { public RemovePortGroupHookTask create(SecurityGroupInterface sgi){ RemovePortGroupHookTask task = new RemovePortGroupHookTask(); task.sgi = sgi; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
RemovePortGroupHookTask extends TransactionalTask { public RemovePortGroupHookTask create(SecurityGroupInterface sgi){ RemovePortGroupHookTask task = new RemovePortGroupHookTask(); task.sgi = sgi; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
RemovePortGroupHookTask extends TransactionalTask { public RemovePortGroupHookTask create(SecurityGroupInterface sgi){ RemovePortGroupHookTask task = new RemovePortGroupHookTask(); task.sgi = sgi; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  RemovePortGroupHookTask create(SecurityGroupInterface sgi); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
RemovePortGroupHookTask extends TransactionalTask { public RemovePortGroupHookTask create(SecurityGroupInterface sgi){ RemovePortGroupHookTask task = new RemovePortGroupHookTask(); task.sgi = sgi; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  RemovePortGroupHookTask create(SecurityGroupInterface sgi); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); public SecurityGroupInterface sgi; }