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")));
}
Aggregations