KubernetesServer - Questions

14 views
Skip to first unread message

cmou...@redhat.com

unread,
May 3, 2017, 3:01:01 AM5/3/17
to fabric8
Hi,

The Fabric8 Kubernetes client project provides a MockServer which is created using the okhttp3.mockwebserver.MockWebServer

**
 
* A scriptable web server. Callers supply canned responses and the server replays them upon request
 
* in sequence.
 
*/
public final class MockWebServer extends ExternalResource implements Closeable {

According to the comment defined within the class MockWebServer of okhttp3, this class will create a response base on the caller supply (= HTTP Request)

Questions:

- Is it correct to say that the KubernetesServer or OpenShiftServer are only able to reply to request without validating the request against the OpenShift/Kubernetes API (https://docs.openshift.com/container-platform/3.5/rest_api/index.html) ?
- Do we have another class able to mock Kube/OpenShift and where the API is validated ?
- Is it documented somewhere how to design such sentence "server.expect().withPath().andReturn(200, ....).once();" ?

Regards

Charles

Ioannis Canellos

unread,
May 3, 2017, 3:24:53 AM5/3/17
to Charles Moulliard, fabric8
Hi Charles,

The Kubernetes/Openshift mocker does not perform any kind of validation. If you need to write a test where you actually validate the request itself (explictly using code), you can do so, using the mockwebserver api (don't recall exactly how, but I am sure that we have such examples). 

I am afraid, that we don't anything more than: https://github.com/fabric8io/mockwebserver


--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ioannis Canellos

Twitter: iocanel

Reply all
Reply to author
Forward
0 new messages