use of io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient in project kubernetes-client by fabric8io.
the class KubernetesMockServerExtension method initializeKubernetesClientAndMockServer.
protected void initializeKubernetesClientAndMockServer(Class<?> testClass) {
EnableKubernetesMockClient a = testClass.getAnnotation(EnableKubernetesMockClient.class);
final Map<ServerRequest, Queue<ServerResponse>> responses = new HashMap<>();
mock = a.crud() ? new KubernetesMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), a.https()) : new KubernetesMockServer(a.https());
mock.init();
mock.setAdaptableOverride(this::extensionMatches);
client = mock.createClient();
this.extensions = a.extensions();
}
Aggregations