Kubernetes mock test post body

3/8/2018

We are using io.fabric8.kubernetes.client.server.mock.KubernetesServer in our unit test to test the interaction with the k8s server.

Is there a way to test the sent body for example a post request to k8s server?

For example

kubernetesServer.expect().put() //
    .withPath(format("/api/v1/namespaces/{}/configmaps/{}", namespace, configMapName)) //
    .andReturn(200, configMap) //
    .once();

we would like to verify, that our code send the correct ConfigMap data to the k8s server.

Did we miss something, or is it really not available?

-- Michael D.
java
kubernetes
mocking
spring
unit-testing

0 Answers