@Test public void testExecute_WithExistingDS_K8sDSIsDeleted() throws Exception { VirtualizationConnector vc = new VirtualizationConnector(); vc.setProviderIpAddress("1.1.1.1"); VirtualSystem vs = new VirtualSystem(null); vs.setVirtualizationConnector(vc); vs.setId(102L); ApplianceSoftwareVersion asv = new ApplianceSoftwareVersion(); asv.setImageUrl("ds-image-url"); asv.setImagePullSecretName("ds-pull-secret-name"); vs.setApplianceSoftwareVersion(asv); DeploymentSpec ds = new DeploymentSpec(vs, null, null, null, null, null); ds.setId(101L); ds.setName("ds-name"); ds.setNamespace("ds-namespace"); ds.setInstanceCount(8); ds.setExternalId(UUID.randomUUID().toString()); when(this.em.find(DeploymentSpec.class, ds.getId())).thenReturn(ds); DeleteK8sDeploymentTask task = this.factory.create(ds, this.k8sDeploymentApi); task.execute(); verify(this.k8sDeploymentApi, Mockito.times(1)).deleteDeployment( ds.getExternalId(), ds.getNamespace(), K8sUtil.getK8sName(ds)); }
public DeleteK8sDeploymentTask create(DeploymentSpec ds) { return create(ds, null); }
DeleteK8sDeploymentTask extends TransactionalTask { public DeleteK8sDeploymentTask create(DeploymentSpec ds) { return create(ds, null); } }
DeleteK8sDeploymentTask extends TransactionalTask { public DeleteK8sDeploymentTask create(DeploymentSpec ds) { return create(ds, null); }  }
DeleteK8sDeploymentTask extends TransactionalTask { public DeleteK8sDeploymentTask create(DeploymentSpec ds) { return create(ds, null); }  DeleteK8sDeploymentTask create(DeploymentSpec ds); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
DeleteK8sDeploymentTask extends TransactionalTask { public DeleteK8sDeploymentTask create(DeploymentSpec ds) { return create(ds, null); }  DeleteK8sDeploymentTask create(DeploymentSpec ds); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }