From 77114c18224dfd4f898fd86ca597a0d6d671772c Mon Sep 17 00:00:00 2001 From: Holly Cummins Date: Thu, 23 Jan 2025 16:59:47 +0000 Subject: [PATCH] Switch away from deprecated resource type --- ...ustomKubernetesMockServerTestResource.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/CustomKubernetesMockServerTestResource.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/CustomKubernetesMockServerTestResource.java index 89e6d9676a27f..0a701affec798 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/CustomKubernetesMockServerTestResource.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/CustomKubernetesMockServerTestResource.java @@ -4,15 +4,16 @@ import io.fabric8.kubernetes.api.model.ConfigMapBuilder; import io.fabric8.kubernetes.api.model.SecretBuilder; -import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer; -import io.quarkus.test.kubernetes.client.KubernetesMockServerTestResource; +import io.quarkus.test.kubernetes.client.KubernetesServerTestResource; -public class CustomKubernetesMockServerTestResource extends KubernetesMockServerTestResource { +public class CustomKubernetesMockServerTestResource extends KubernetesServerTestResource { // setup the ConfigMap objects that the application expects to lookup configuration from @Override - public void configureMockServer(KubernetesMockServer mockServer) { - mockServer.expect().get().withPath("/api/v1/namespaces/test/configmaps/cmap1") + protected void configureServer() { + super.configureServer(); + System.out.println("HOLLY KUBE configuring mock seerver " + server); + server.expect().get().withPath("/api/v1/namespaces/test/configmaps/cmap1") .andReturn(200, configMapBuilder("cmap1") .addToData("dummy", "dummy") .addToData("overridden.secret", "cm") // will be overridden since secrets have a higher priority @@ -24,12 +25,12 @@ public void configureMockServer(KubernetesMockServer mockServer) { .addToData("application.yaml", "some:\n prop4: val4").build()) .once(); - mockServer.expect().get().withPath("/api/v1/namespaces/test/configmaps/cmap2") + server.expect().get().withPath("/api/v1/namespaces/test/configmaps/cmap2") .andReturn(200, configMapBuilder("cmap2") .addToData("application.yaml", "some:\n prop4: val4").build()) .once(); - mockServer.expect().get().withPath("/api/v1/namespaces/demo/configmaps/cmap3") + server.expect().get().withPath("/api/v1/namespaces/demo/configmaps/cmap3") .andReturn(200, configMapBuilder("cmap3") .addToData("dummy", "dummyFromDemo") .addToData("some.prop1", "val1FromDemo") @@ -39,7 +40,7 @@ public void configureMockServer(KubernetesMockServer mockServer) { .addToData("application.yaml", "some:\n prop4: val4FromDemo").build()) .once(); - mockServer.expect().get().withPath("/api/v1/namespaces/test/secrets/s1") + server.expect().get().withPath("/api/v1/namespaces/test/secrets/s1") .andReturn(200, secretBuilder("s1") .addToData("dummysecret", encodeValue("dummysecret")) .addToData("overridden.secret", encodeValue("secret")) @@ -49,7 +50,7 @@ public void configureMockServer(KubernetesMockServer mockServer) { .addToData("application.yaml", encodeValue("secret:\n prop4: val4")).build()) .once(); - mockServer.expect().get().withPath("/api/v1/namespaces/demo/secrets/s1") + server.expect().get().withPath("/api/v1/namespaces/demo/secrets/s1") .andReturn(200, secretBuilder("s1") .addToData("dummysecret", encodeValue("dummysecretFromDemo")) .addToData("overridden.secret", encodeValue("secretFromDemo"))