@Test public void testGetPodsbyLabel_WhenK8sReturnsPodWithMatchingId_ReturnsPod() throws Exception { String name = UUID.randomUUID().toString(); String namespace = UUID.randomUUID().toString(); String uid = UUID.randomUUID().toString(); Pod pod = newPod(uid, namespace, name, UUID.randomUUID().toString()); mockPodsByName(namespace, name, pod); KubernetesPod result = this.service.getPodById(uid, namespace, name); assertNotNull("The result should not be null.", result); assertPodFields(pod, result); }
public KubernetesPod getPodById(String uid, String namespace, String name) throws VmidcException { if (uid == null) { throw new IllegalArgumentException("Uid should not be null"); } if (name == null) { throw new IllegalArgumentException("Name should not be null"); } if (namespace == null) { throw new IllegalArgumentException("Namespace should not be null"); } KubernetesPod pod = getPodsByName(namespace, name); return (pod == null || !pod.getUid().equals(uid)) ? null : pod; }
KubernetesPodApi extends KubernetesApi { public KubernetesPod getPodById(String uid, String namespace, String name) throws VmidcException { if (uid == null) { throw new IllegalArgumentException("Uid should not be null"); } if (name == null) { throw new IllegalArgumentException("Name should not be null"); } if (namespace == null) { throw new IllegalArgumentException("Namespace should not be null"); } KubernetesPod pod = getPodsByName(namespace, name); return (pod == null || !pod.getUid().equals(uid)) ? null : pod; } }
KubernetesPodApi extends KubernetesApi { public KubernetesPod getPodById(String uid, String namespace, String name) throws VmidcException { if (uid == null) { throw new IllegalArgumentException("Uid should not be null"); } if (name == null) { throw new IllegalArgumentException("Name should not be null"); } if (namespace == null) { throw new IllegalArgumentException("Namespace should not be null"); } KubernetesPod pod = getPodsByName(namespace, name); return (pod == null || !pod.getUid().equals(uid)) ? null : pod; } KubernetesPodApi(KubernetesClient client); }
KubernetesPodApi extends KubernetesApi { public KubernetesPod getPodById(String uid, String namespace, String name) throws VmidcException { if (uid == null) { throw new IllegalArgumentException("Uid should not be null"); } if (name == null) { throw new IllegalArgumentException("Name should not be null"); } if (namespace == null) { throw new IllegalArgumentException("Namespace should not be null"); } KubernetesPod pod = getPodsByName(namespace, name); return (pod == null || !pod.getUid().equals(uid)) ? null : pod; } KubernetesPodApi(KubernetesClient client); List<KubernetesPod> getPodsByLabel(String label); KubernetesPod getPodById(String uid, String namespace, String name); }
KubernetesPodApi extends KubernetesApi { public KubernetesPod getPodById(String uid, String namespace, String name) throws VmidcException { if (uid == null) { throw new IllegalArgumentException("Uid should not be null"); } if (name == null) { throw new IllegalArgumentException("Name should not be null"); } if (namespace == null) { throw new IllegalArgumentException("Namespace should not be null"); } KubernetesPod pod = getPodsByName(namespace, name); return (pod == null || !pod.getUid().equals(uid)) ? null : pod; } KubernetesPodApi(KubernetesClient client); List<KubernetesPod> getPodsByLabel(String label); KubernetesPod getPodById(String uid, String namespace, String name);  }