diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/MixedCrudTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/MixedCrudTest.java index 5c01f4ac81f..815c569f90b 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/MixedCrudTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/MixedCrudTest.java @@ -41,7 +41,7 @@ class MixedCrudTest { - KubernetesMockServer server; + private KubernetesMockServer server; private KubernetesClient client; @BeforeEach diff --git a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java index e0038a17c72..1cdb07be6ff 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/kubernetes/client/mock/PodTest.java @@ -24,9 +24,9 @@ import io.fabric8.kubernetes.api.model.PodListBuilder; import io.fabric8.kubernetes.api.model.WatchEvent; import io.fabric8.kubernetes.api.model.policy.v1.EvictionBuilder; -import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.KubernetesClientException; import io.fabric8.kubernetes.client.LocalPortForward; +import io.fabric8.kubernetes.client.NamespacedKubernetesClient; import io.fabric8.kubernetes.client.PortForward; import io.fabric8.kubernetes.client.Watch; import io.fabric8.kubernetes.client.Watcher; @@ -83,15 +83,14 @@ class PodTest { KubernetesMockServer server; + NamespacedKubernetesClient client; @TempDir Path tempDir; - private KubernetesClient client; - @BeforeEach void setUp() { - client = server.createClient().inNamespace("test"); + client = client.inNamespace("test"); } @Test diff --git a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/GroupTest.java b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/GroupTest.java index c0a53f013de..267fcfd2574 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/GroupTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/GroupTest.java @@ -24,7 +24,6 @@ import io.fabric8.openshift.api.model.GroupList; import io.fabric8.openshift.api.model.GroupListBuilder; import io.fabric8.openshift.client.NamespacedOpenShiftClient; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -39,11 +38,6 @@ class GroupTest { KubernetesMockServer server; NamespacedOpenShiftClient client; - @BeforeEach - void setUp() { - client = server.createClient().adapt(NamespacedOpenShiftClient.class); - } - @Test void testList() { server.expect().withPath("/apis/user.openshift.io/v1/groups").andReturn(200, new GroupListBuilder() diff --git a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SubjectAccessReviewTest.java b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SubjectAccessReviewTest.java index 0602b646604..742c63c30f1 100644 --- a/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SubjectAccessReviewTest.java +++ b/kubernetes-tests/src/test/java/io/fabric8/openshift/client/server/mock/SubjectAccessReviewTest.java @@ -30,7 +30,6 @@ import io.fabric8.openshift.api.model.SubjectRulesReview; import io.fabric8.openshift.api.model.SubjectRulesReviewBuilder; import io.fabric8.openshift.client.NamespacedOpenShiftClient; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static java.net.HttpURLConnection.HTTP_CREATED; @@ -44,11 +43,6 @@ class SubjectAccessReviewTest { KubernetesMockServer server; NamespacedOpenShiftClient client; - @BeforeEach - void setUp() { - client = server.createClient().adapt(NamespacedOpenShiftClient.class); - } - @Test void testCreate() { server.expect().withPath("/apis/authorization.openshift.io/v1/subjectaccessreviews")