public class KubernetesMixedDispatcher extends okhttp3.mockwebserver.Dispatcher implements Resetable, CustomResourceAware
MockDispatcher and a KubernetesCrudDispatcher.
Any request matching a pre-recorded response for the MockDispatcher is handled by the MockDispatcher. The rest of requests are forwarded to the KubernetesCrudDispatcher.
This dispatcher is useful to use the KubernetesMockServer in a mixed CRUD mode.
| Constructor and Description |
|---|
KubernetesMixedDispatcher(Map<ServerRequest,Queue<ServerResponse>> responses) |
KubernetesMixedDispatcher(Map<ServerRequest,Queue<ServerResponse>> responses,
List<io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext> crdContexts) |
| Modifier and Type | Method and Description |
|---|---|
okhttp3.mockwebserver.MockResponse |
dispatch(okhttp3.mockwebserver.RecordedRequest request) |
void |
expectCustomResource(io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext rdc) |
void |
reset()
return the resource to its initial state
|
public KubernetesMixedDispatcher(Map<ServerRequest,Queue<ServerResponse>> responses)
public KubernetesMixedDispatcher(Map<ServerRequest,Queue<ServerResponse>> responses, List<io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext> crdContexts)
public okhttp3.mockwebserver.MockResponse dispatch(okhttp3.mockwebserver.RecordedRequest request)
throws InterruptedException
dispatch in class okhttp3.mockwebserver.DispatcherInterruptedExceptionpublic void reset()
Resetablepublic void expectCustomResource(io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext rdc)
expectCustomResource in interface CustomResourceAwareCopyright © 2015–2024 Red Hat. All rights reserved.