@Test public void testExecute_WhenUpdateInspectionHookSucceeds_ExecutionFinishes() throws Exception { SecurityGroup sg = newSecurityGroup(); SecurityGroupInterface sgi = registerNewSGI(sg, 2L); DistributedApplianceInstance dai = registerNewDAI(); SdnRedirectionApi redirectionApi = mockUpdateInspectionHook(sgi, dai, null); registerNetworkRedirectionApi(redirectionApi, sgi.getVirtualSystem()); UpdatePortGroupHookTask task = this.factory.create(sgi, dai); task.execute(); Mockito.verify(redirectionApi, Mockito.times(1)) .updateInspectionHook(argThat(new InspectionHookMatcher(dai, sgi))); }
public UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){ UpdatePortGroupHookTask task = new UpdatePortGroupHookTask(sgi, dai); task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
UpdatePortGroupHookTask extends BasePortGroupHookTask { public UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){ UpdatePortGroupHookTask task = new UpdatePortGroupHookTask(sgi, dai); task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
UpdatePortGroupHookTask extends BasePortGroupHookTask { public UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){ UpdatePortGroupHookTask task = new UpdatePortGroupHookTask(sgi, dai); task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } UpdatePortGroupHookTask(); private  UpdatePortGroupHookTask(SecurityGroupInterface sgi, DistributedApplianceInstance dai); }
UpdatePortGroupHookTask extends BasePortGroupHookTask { public UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){ UpdatePortGroupHookTask task = new UpdatePortGroupHookTask(sgi, dai); task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } UpdatePortGroupHookTask(); private  UpdatePortGroupHookTask(SecurityGroupInterface sgi, DistributedApplianceInstance dai); UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai); @Override void executeTransaction(EntityManager em); @Override String getName(); }
UpdatePortGroupHookTask extends BasePortGroupHookTask { public UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){ UpdatePortGroupHookTask task = new UpdatePortGroupHookTask(sgi, dai); task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } UpdatePortGroupHookTask(); private  UpdatePortGroupHookTask(SecurityGroupInterface sgi, DistributedApplianceInstance dai); UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai); @Override void executeTransaction(EntityManager em); @Override String getName();  }