Class KubernetesMixedDispatcher

  • All Implemented Interfaces:
    CustomResourceAware, Resetable

    public class KubernetesMixedDispatcher
    extends io.fabric8.mockwebserver.http.Dispatcher
    implements Resetable, CustomResourceAware
    A composite dispatcher consistent of a 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 Detail

      • KubernetesMixedDispatcher

        public KubernetesMixedDispatcher​(Map<io.fabric8.mockwebserver.ServerRequest,​Queue<io.fabric8.mockwebserver.ServerResponse>> responses)
      • KubernetesMixedDispatcher

        public KubernetesMixedDispatcher​(Map<io.fabric8.mockwebserver.ServerRequest,​Queue<io.fabric8.mockwebserver.ServerResponse>> responses,
                                         List<io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext> crdContexts)
    • Method Detail

      • dispatch

        public io.fabric8.mockwebserver.http.MockResponse dispatch​(io.fabric8.mockwebserver.http.RecordedRequest request)
        Specified by:
        dispatch in class io.fabric8.mockwebserver.http.Dispatcher
      • reset

        public void reset()
        Description copied from interface: Resetable
        return the resource to its initial state
        Specified by:
        reset in interface Resetable
      • expectCustomResource

        public void expectCustomResource​(io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext rdc)
        Specified by:
        expectCustomResource in interface CustomResourceAware