@Test public void testExecute_WhenSDNReturnsNetworkElement_OrphanDAI_DAICreatedWithInspectionElementId() throws Exception { KubernetesPod k8sPod = createKubernetesPod(); NetworkElement podPort = createNetworkElement(); DistributedApplianceInstance dai = new DistributedApplianceInstance(); dai.setInspectionElementId(UUID.randomUUID().toString()); dai.setInspectionElementParentId(UUID.randomUUID().toString()); dai.setId(101L); DeploymentSpec ds = createAndRegisterDeploymentSpec(dai); registerNetworkElement(ds, podPort, k8sPod); CreateOrUpdateK8sDAITask task = this.factory.create(ds, k8sPod); task.execute(); verify(this.em, Mockito.times(1)).persist(Mockito.argThat(new DAIMatcher(podPort, k8sPod, dai.getInspectionElementId(), dai.getInspectionElementParentId()))); verify(this.em, Mockito.times(1)).remove(dai); }
public CreateOrUpdateK8sDAITask create(DeploymentSpec ds, KubernetesPod k8sPod) { return create(ds, k8sPod, null); }
CreateOrUpdateK8sDAITask extends TransactionalTask { public CreateOrUpdateK8sDAITask create(DeploymentSpec ds, KubernetesPod k8sPod) { return create(ds, k8sPod, null); } }
CreateOrUpdateK8sDAITask extends TransactionalTask { public CreateOrUpdateK8sDAITask create(DeploymentSpec ds, KubernetesPod k8sPod) { return create(ds, k8sPod, null); }  }
CreateOrUpdateK8sDAITask extends TransactionalTask { public CreateOrUpdateK8sDAITask create(DeploymentSpec ds, KubernetesPod k8sPod) { return create(ds, k8sPod, null); }  CreateOrUpdateK8sDAITask create(DeploymentSpec ds, KubernetesPod k8sPod); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects(); }
CreateOrUpdateK8sDAITask extends TransactionalTask { public CreateOrUpdateK8sDAITask create(DeploymentSpec ds, KubernetesPod k8sPod) { return create(ds, k8sPod, null); }  CreateOrUpdateK8sDAITask create(DeploymentSpec ds, KubernetesPod k8sPod); @Override void executeTransaction(EntityManager em); @Override String getName(); @Override Set<LockObjectReference> getObjects();  }