@Test public void testExecute_WhenGetDeploymentReturnsNull_ThrowsVmidcException() throws Exception { DeploymentSpec ds = createDS(); when(this.em.find(DeploymentSpec.class, ds.getId())).thenReturn(ds); registerKubernetesDeployment(ds, null); CheckK8sDeploymentStateTask task = this.factory.create(ds, this.k8sDeploymentApi); this.exception.expect(VmidcException.class); this.exception.expectMessage("Kubernetes returned a null deployment"); task.execute(); }
CheckK8sDeploymentStateTask create(DeploymentSpec ds, KubernetesDeploymentApi k8sDeploymentApi) { CheckK8sDeploymentStateTask task = new CheckK8sDeploymentStateTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.ds = ds; task.k8sDeploymentApi = k8sDeploymentApi; return task; }
CheckK8sDeploymentStateTask extends TransactionalTask { CheckK8sDeploymentStateTask create(DeploymentSpec ds, KubernetesDeploymentApi k8sDeploymentApi) { CheckK8sDeploymentStateTask task = new CheckK8sDeploymentStateTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.ds = ds; task.k8sDeploymentApi = k8sDeploymentApi; return task; } }
CheckK8sDeploymentStateTask extends TransactionalTask { CheckK8sDeploymentStateTask create(DeploymentSpec ds, KubernetesDeploymentApi k8sDeploymentApi) { CheckK8sDeploymentStateTask task = new CheckK8sDeploymentStateTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.ds = ds; task.k8sDeploymentApi = k8sDeploymentApi; return task; }  }
CheckK8sDeploymentStateTask extends TransactionalTask { CheckK8sDeploymentStateTask create(DeploymentSpec ds, KubernetesDeploymentApi k8sDeploymentApi) { CheckK8sDeploymentStateTask task = new CheckK8sDeploymentStateTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.ds = ds; task.k8sDeploymentApi = k8sDeploymentApi; return task; }  CheckK8sDeploymentStateTask create(DeploymentSpec ds); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
CheckK8sDeploymentStateTask extends TransactionalTask { CheckK8sDeploymentStateTask create(DeploymentSpec ds, KubernetesDeploymentApi k8sDeploymentApi) { CheckK8sDeploymentStateTask task = new CheckK8sDeploymentStateTask(); task.dbConnectionManager = this.dbConnectionManager; task.txBroadcastUtil = this.txBroadcastUtil; task.ds = ds; task.k8sDeploymentApi = k8sDeploymentApi; return task; }  CheckK8sDeploymentStateTask create(DeploymentSpec ds); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }