@Test public void testExecute_WhenK8sPodAlreadyBelongsToAnotherSG_ThrowsVmidException() throws Exception { CreateK8sLabelPodTask task = this.factoryTask.create(ALREADY_PROTECTED_K8S_POD, ALREADY_PROTECTED_POD_SGM_LABEL); this.exception.expect(VmidcException.class); this.exception.expectMessage("is already part of the security group"); task.execute(); }
public CreateK8sLabelPodTask create(KubernetesPod k8sPod, Label label) { CreateK8sLabelPodTask task = new CreateK8sLabelPodTask(); task.k8sPod = k8sPod; task.label = label; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }
CreateK8sLabelPodTask extends TransactionalTask { public CreateK8sLabelPodTask create(KubernetesPod k8sPod, Label label) { CreateK8sLabelPodTask task = new CreateK8sLabelPodTask(); task.k8sPod = k8sPod; task.label = label; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; } }
CreateK8sLabelPodTask extends TransactionalTask { public CreateK8sLabelPodTask create(KubernetesPod k8sPod, Label label) { CreateK8sLabelPodTask task = new CreateK8sLabelPodTask(); task.k8sPod = k8sPod; task.label = label; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  }
CreateK8sLabelPodTask extends TransactionalTask { public CreateK8sLabelPodTask create(KubernetesPod k8sPod, Label label) { CreateK8sLabelPodTask task = new CreateK8sLabelPodTask(); task.k8sPod = k8sPod; task.label = label; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  @Override void executeTransaction(EntityManager em); CreateK8sLabelPodTask create(KubernetesPod k8sPod, Label label); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
CreateK8sLabelPodTask extends TransactionalTask { public CreateK8sLabelPodTask create(KubernetesPod k8sPod, Label label) { CreateK8sLabelPodTask task = new CreateK8sLabelPodTask(); task.k8sPod = k8sPod; task.label = label; task.apiFactoryService = this.apiFactoryService; task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; return task; }  @Override void executeTransaction(EntityManager em); CreateK8sLabelPodTask create(KubernetesPod k8sPod, Label label); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }