Search in sources :

Example 1 with V1JobStatus

use of io.kubernetes.client.openapi.models.V1JobStatus in project java by kubernetes-client.

the class GenericKubernetesApiTest method updateStatusNamespacedJobReturningObject.

@Test
public void updateStatusNamespacedJobReturningObject() {
    V1Job foo1 = new V1Job().kind("Job").metadata(new V1ObjectMeta().namespace("default").name("foo1"));
    foo1.setStatus(new V1JobStatus().failed(1));
    stubFor(patch(urlEqualTo("/apis/batch/v1/namespaces/default/jobs/foo1/status")).willReturn(aResponse().withStatus(200).withBody(new JSON().serialize(foo1))));
    KubernetesApiResponse<V1Job> jobListResp = jobClient.updateStatus(foo1, t -> t.getStatus());
    assertTrue(jobListResp.isSuccess());
    assertEquals(foo1, jobListResp.getObject());
    assertNull(jobListResp.getStatus());
    verify(1, patchRequestedFor(urlPathEqualTo("/apis/batch/v1/namespaces/default/jobs/foo1/status")));
}
Also used : V1Job(io.kubernetes.client.openapi.models.V1Job) V1ObjectMeta(io.kubernetes.client.openapi.models.V1ObjectMeta) V1JobStatus(io.kubernetes.client.openapi.models.V1JobStatus) JSON(io.kubernetes.client.openapi.JSON) Test(org.junit.Test)

Aggregations

JSON (io.kubernetes.client.openapi.JSON)1 V1Job (io.kubernetes.client.openapi.models.V1Job)1 V1JobStatus (io.kubernetes.client.openapi.models.V1JobStatus)1 V1ObjectMeta (io.kubernetes.client.openapi.models.V1ObjectMeta)1 Test (org.junit.Test)1