@Test public void testGetDeploymentbyId_WhenK8ClientThrowsKubernetesClientException_ThrowsVmidcException() throws Exception { this.exception.expect(VmidcException.class); when(this.extensionsApiMock.deployments()).thenThrow(new KubernetesClientException("")); this.deploymentApi.getDeploymentById("1234", "sample_name", "sample_label"); }
public KubernetesDeployment getDeploymentById(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"); } KubernetesDeployment deployment = getDeploymentByName(namespace, name); return (deployment == null || !deployment.getUid().equals(uid)) ? null : deployment; }
KubernetesDeploymentApi extends KubernetesApi { public KubernetesDeployment getDeploymentById(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"); } KubernetesDeployment deployment = getDeploymentByName(namespace, name); return (deployment == null || !deployment.getUid().equals(uid)) ? null : deployment; } }
KubernetesDeploymentApi extends KubernetesApi { public KubernetesDeployment getDeploymentById(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"); } KubernetesDeployment deployment = getDeploymentByName(namespace, name); return (deployment == null || !deployment.getUid().equals(uid)) ? null : deployment; } KubernetesDeploymentApi(KubernetesClient client); }
KubernetesDeploymentApi extends KubernetesApi { public KubernetesDeployment getDeploymentById(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"); } KubernetesDeployment deployment = getDeploymentByName(namespace, name); return (deployment == null || !deployment.getUid().equals(uid)) ? null : deployment; } KubernetesDeploymentApi(KubernetesClient client); KubernetesDeployment getDeploymentById(String uid, String namespace, String name); void deleteDeployment(String uid, String namespace, String name); void updateDeploymentReplicaCount(String uid, String namespace, String name, int replicaCount); String createDeployment(KubernetesDeployment deployment); }
KubernetesDeploymentApi extends KubernetesApi { public KubernetesDeployment getDeploymentById(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"); } KubernetesDeployment deployment = getDeploymentByName(namespace, name); return (deployment == null || !deployment.getUid().equals(uid)) ? null : deployment; } KubernetesDeploymentApi(KubernetesClient client); KubernetesDeployment getDeploymentById(String uid, String namespace, String name); void deleteDeployment(String uid, String namespace, String name); void updateDeploymentReplicaCount(String uid, String namespace, String name, int replicaCount); String createDeployment(KubernetesDeployment deployment); final static String OSC_DEPLOYMENT_LABEL_NAME; }