@Test public void testExecute_WhenCreateNetworkRedirectionApiFails_ThrowsTheUnhandledException() throws Exception { SecurityGroupInterface sgi = registerNewSGI(2L); when(this.apiFactoryServiceMock.createNetworkRedirectionApi(sgi.getVirtualSystem())) .thenThrow(new IllegalStateException()); this.exception.expect(IllegalStateException.class); RemovePortGroupHookTask task = this.factory.create(sgi); task.execute(); }
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; }