@Test public void testExecute_WithVariousSecurityGroups_ExpectsCorrectTaskGraph() throws Exception { this.factoryTask.checkK8sSecurityGroupLabelMetaTask = new CheckK8sSecurityGroupLabelMetaTask(); this.factoryTask.portGroupCheckMetaTask = new PortGroupCheckMetaTask(); this.factoryTask.deleteSecurityGroupFromDbTask = new DeleteSecurityGroupFromDbTask(); this.factoryTask.markSecurityGroupInterfaceDeleteTask = new MarkSecurityGroupInterfaceDeleteTask(); this.factoryTask.securityGroupMemberMapPropagateMetaTask = new SecurityGroupMemberMapPropagateMetaTask(); this.factoryTask.checkPortGroupHookMetaTask = new CheckPortGroupHookMetaTask(); this.factoryTask.deleteSecurityGroupInterfaceTask = new DeleteSecurityGroupInterfaceTask(); UpdateOrDeleteK8sSecurityGroupMetaTask task = this.factoryTask.create(this.sg); task.execute(); TaskGraphHelper.validateTaskGraph(task, this.expectedGraph); }
public UpdateOrDeleteK8sSecurityGroupMetaTask create(SecurityGroup sg) { UpdateOrDeleteK8sSecurityGroupMetaTask task = new UpdateOrDeleteK8sSecurityGroupMetaTask(); task.sg = sg; task.checkK8sSecurityGroupLabelMetaTask = this.checkK8sSecurityGroupLabelMetaTask; task.portGroupCheckMetaTask = this.portGroupCheckMetaTask; task.deleteSecurityGroupFromDbTask = this.deleteSecurityGroupFromDbTask; task.markSecurityGroupInterfaceDeleteTask = this.markSecurityGroupInterfaceDeleteTask; task.securityGroupMemberMapPropagateMetaTask = this.securityGroupMemberMapPropagateMetaTask; task.checkPortGroupHookMetaTask = this.checkPortGroupHookMetaTask; task.deleteSecurityGroupInterfaceTask = this.deleteSecurityGroupInterfaceTask; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
UpdateOrDeleteK8sSecurityGroupMetaTask extends TransactionalMetaTask { public UpdateOrDeleteK8sSecurityGroupMetaTask create(SecurityGroup sg) { UpdateOrDeleteK8sSecurityGroupMetaTask task = new UpdateOrDeleteK8sSecurityGroupMetaTask(); task.sg = sg; task.checkK8sSecurityGroupLabelMetaTask = this.checkK8sSecurityGroupLabelMetaTask; task.portGroupCheckMetaTask = this.portGroupCheckMetaTask; task.deleteSecurityGroupFromDbTask = this.deleteSecurityGroupFromDbTask; task.markSecurityGroupInterfaceDeleteTask = this.markSecurityGroupInterfaceDeleteTask; task.securityGroupMemberMapPropagateMetaTask = this.securityGroupMemberMapPropagateMetaTask; task.checkPortGroupHookMetaTask = this.checkPortGroupHookMetaTask; task.deleteSecurityGroupInterfaceTask = this.deleteSecurityGroupInterfaceTask; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
UpdateOrDeleteK8sSecurityGroupMetaTask extends TransactionalMetaTask { public UpdateOrDeleteK8sSecurityGroupMetaTask create(SecurityGroup sg) { UpdateOrDeleteK8sSecurityGroupMetaTask task = new UpdateOrDeleteK8sSecurityGroupMetaTask(); task.sg = sg; task.checkK8sSecurityGroupLabelMetaTask = this.checkK8sSecurityGroupLabelMetaTask; task.portGroupCheckMetaTask = this.portGroupCheckMetaTask; task.deleteSecurityGroupFromDbTask = this.deleteSecurityGroupFromDbTask; task.markSecurityGroupInterfaceDeleteTask = this.markSecurityGroupInterfaceDeleteTask; task.securityGroupMemberMapPropagateMetaTask = this.securityGroupMemberMapPropagateMetaTask; task.checkPortGroupHookMetaTask = this.checkPortGroupHookMetaTask; task.deleteSecurityGroupInterfaceTask = this.deleteSecurityGroupInterfaceTask; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
UpdateOrDeleteK8sSecurityGroupMetaTask extends TransactionalMetaTask { public UpdateOrDeleteK8sSecurityGroupMetaTask create(SecurityGroup sg) { UpdateOrDeleteK8sSecurityGroupMetaTask task = new UpdateOrDeleteK8sSecurityGroupMetaTask(); task.sg = sg; task.checkK8sSecurityGroupLabelMetaTask = this.checkK8sSecurityGroupLabelMetaTask; task.portGroupCheckMetaTask = this.portGroupCheckMetaTask; task.deleteSecurityGroupFromDbTask = this.deleteSecurityGroupFromDbTask; task.markSecurityGroupInterfaceDeleteTask = this.markSecurityGroupInterfaceDeleteTask; task.securityGroupMemberMapPropagateMetaTask = this.securityGroupMemberMapPropagateMetaTask; task.checkPortGroupHookMetaTask = this.checkPortGroupHookMetaTask; task.deleteSecurityGroupInterfaceTask = this.deleteSecurityGroupInterfaceTask; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  UpdateOrDeleteK8sSecurityGroupMetaTask create(SecurityGroup sg); @Override TaskGraph getTaskGraph(); @Override String getName(); @Override void executeTransaction(EntityManager em); @Override Set<LockObjectReference> getObjects(); }
UpdateOrDeleteK8sSecurityGroupMetaTask extends TransactionalMetaTask { public UpdateOrDeleteK8sSecurityGroupMetaTask create(SecurityGroup sg) { UpdateOrDeleteK8sSecurityGroupMetaTask task = new UpdateOrDeleteK8sSecurityGroupMetaTask(); task.sg = sg; task.checkK8sSecurityGroupLabelMetaTask = this.checkK8sSecurityGroupLabelMetaTask; task.portGroupCheckMetaTask = this.portGroupCheckMetaTask; task.deleteSecurityGroupFromDbTask = this.deleteSecurityGroupFromDbTask; task.markSecurityGroupInterfaceDeleteTask = this.markSecurityGroupInterfaceDeleteTask; task.securityGroupMemberMapPropagateMetaTask = this.securityGroupMemberMapPropagateMetaTask; task.checkPortGroupHookMetaTask = this.checkPortGroupHookMetaTask; task.deleteSecurityGroupInterfaceTask = this.deleteSecurityGroupInterfaceTask; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  UpdateOrDeleteK8sSecurityGroupMetaTask create(SecurityGroup sg); @Override TaskGraph getTaskGraph(); @Override String getName(); @Override void executeTransaction(EntityManager em); @Override Set<LockObjectReference> getObjects();  }