@Test public void testExecute_WhenCreateNetworkRedirectionApiFails_ThrowsTheUnhandledException() throws Exception { SecurityGroup sg = registerSecurityGroup("SG", 1L, null); when(this.apiFactoryServiceMock.createNetworkRedirectionApi(sg.getVirtualizationConnector())) .thenThrow(new IllegalStateException()); this.exception.expect(IllegalStateException.class); DeletePortGroupTask task = this.factoryTask.create(sg, null); task.execute(); }
public DeletePortGroupTask create(SecurityGroup securityGroup, NetworkElementImpl portGroup){ DeletePortGroupTask task = new DeletePortGroupTask(); task.securityGroup = securityGroup; task.portGroup = portGroup; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
DeletePortGroupTask extends TransactionalTask { public DeletePortGroupTask create(SecurityGroup securityGroup, NetworkElementImpl portGroup){ DeletePortGroupTask task = new DeletePortGroupTask(); task.securityGroup = securityGroup; task.portGroup = portGroup; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
DeletePortGroupTask extends TransactionalTask { public DeletePortGroupTask create(SecurityGroup securityGroup, NetworkElementImpl portGroup){ DeletePortGroupTask task = new DeletePortGroupTask(); task.securityGroup = securityGroup; task.portGroup = portGroup; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
DeletePortGroupTask extends TransactionalTask { public DeletePortGroupTask create(SecurityGroup securityGroup, NetworkElementImpl portGroup){ DeletePortGroupTask task = new DeletePortGroupTask(); task.securityGroup = securityGroup; task.portGroup = portGroup; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  DeletePortGroupTask create(SecurityGroup securityGroup, NetworkElementImpl portGroup); @Override void executeTransaction(EntityManager em); @Override String getName(); }
DeletePortGroupTask extends TransactionalTask { public DeletePortGroupTask create(SecurityGroup securityGroup, NetworkElementImpl portGroup){ DeletePortGroupTask task = new DeletePortGroupTask(); task.securityGroup = securityGroup; task.portGroup = portGroup; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  DeletePortGroupTask create(SecurityGroup securityGroup, NetworkElementImpl portGroup); @Override void executeTransaction(EntityManager em); @Override String getName();  }