diff --git a/CHANGELOG.md b/CHANGELOG.md
index c0a31e67b39..35bbff77f9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
* Fix #4459: Fixed OSGi startup exceptions while using KubernetesClient/OpenShiftClient
* Fix #4482: Fixing blocking behavior of okhttp log watch
* Fix #4473: Fix regression in backoff interval introduced in #4365
+* Fix #3924: Remove extensions mock modules
#### Improvements
* Fix #4348: Introduce specific annotations for the generators
diff --git a/extensions/camel-k/mock/pom.xml b/extensions/camel-k/mock/pom.xml
deleted file mode 100644
index e96b77db870..00000000000
--- a/extensions/camel-k/mock/pom.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
- 4.0.0
-
- io.fabric8
- camel-k-extension-pom
- 6.2-SNAPSHOT
-
-
-
- camel-k-mock
- Fabric8 :: Camel-K :: Server Mock
-
-
-
- io.fabric8
- kubernetes-server-mock
-
-
-
- io.fabric8
- camel-k-client
-
-
-
- org.junit.jupiter
- junit-jupiter-api
- provided
-
-
-
-
diff --git a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKMockServer.java b/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKMockServer.java
deleted file mode 100644
index 37bb8b2d386..00000000000
--- a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKMockServer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.camelk.mock;
-
-import io.fabric8.camelk.client.DefaultCamelKClient;
-import io.fabric8.camelk.client.NamespacedCamelKClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.Dispatcher;
-import okhttp3.mockwebserver.MockWebServer;
-
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * @deprecated use {@link KubernetesMockServer} instead
- */
-@Deprecated
-public class CamelKMockServer extends KubernetesMockServer {
-
- public CamelKMockServer() {
- super();
- }
-
- public CamelKMockServer(boolean useHttps) {
- super(useHttps);
- }
-
- public CamelKMockServer(Context context, MockWebServer server, Map> responses,
- Dispatcher dispatcher, boolean useHttps) {
- super(context, server, responses, dispatcher, useHttps);
- }
-
- @Override
- public String[] getRootPaths() {
- return new String[] { "/api", "/apis/camel.apache.org" };
- }
-
- public NamespacedCamelKClient createCamelKClient() {
- return new DefaultCamelKClient(getMockConfiguration());
- }
-}
diff --git a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKMockServerExtension.java b/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKMockServerExtension.java
deleted file mode 100644
index 68926ef805b..00000000000
--- a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKMockServerExtension.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.fabric8.camelk.mock;
-
-
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServerExtension;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.camelk.client.NamespacedCamelKClient;
-import io.fabric8.camelk.client.CamelKClient;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.MockWebServer;
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * The class that implements JUnit5 extension mechanism. You can use it directly in your JUnit test
- * by annotating it with @ExtendWith(CamelKMockServerExtension.class)
or through
- * @EnableCamelKMockClient
annotation
- */
-public class CamelKMockServerExtension extends KubernetesMockServerExtension {
- private CamelKMockServer camelKMockServer;
- private NamespacedCamelKClient camelKClient;
-
- @Override
- protected void destroy() {
- camelKMockServer.destroy();
- camelKClient.close();
- }
-
- @Override
- protected Class> getClientType() {
- return CamelKClient.class;
- }
-
- @Override
- protected Class> getKubernetesMockServerType() {
- return CamelKMockServer.class;
- }
-
- @Override
- protected void initializeKubernetesClientAndMockServer(Class> testClass) {
- EnableCamelKMockClient a = testClass.getAnnotation(EnableCamelKMockClient.class);
- final Map> responses = new HashMap<>();
- camelKMockServer = a.crud()
- ? new CamelKMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), a.https())
- : new CamelKMockServer(a.https());
- camelKMockServer.init();
- camelKClient = camelKMockServer.createCamelKClient();
- }
-
- @Override
- protected void setFieldIfKubernetesClientOrMockServer(ExtensionContext context, boolean isStatic, Field field) throws IllegalAccessException {
- setFieldIfEqualsToProvidedType(context, isStatic, field, getClientType(), (i, f) -> f.set(i, camelKClient));
- setFieldIfEqualsToProvidedType(context, isStatic, field, getKubernetesMockServerType(), (i, f) -> f.set(i, camelKMockServer));
- }
-}
diff --git a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKServer.java b/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKServer.java
deleted file mode 100644
index 59073d4c3b1..00000000000
--- a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/CamelKServer.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.camelk.mock;
-
-import io.fabric8.camelk.client.CamelKClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import io.fabric8.mockwebserver.dsl.MockServerExpectation;
-import okhttp3.mockwebserver.MockWebServer;
-import org.junit.rules.ExternalResource;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-public class CamelKServer extends ExternalResource {
-
- protected CamelKMockServer mock;
- private CamelKClient client;
-
- private final boolean https;
- // In this mode the mock web server will store, read, update and delete
- // kubernetes resources using an in memory map and will appear as a real api
- // server.
- private final boolean crudMode;
-
- public CamelKServer() {
- this(true, false);
- }
-
- public CamelKServer(boolean https) {
- this(https, false);
- }
-
- public CamelKServer(boolean https, boolean crudMode) {
- this.https = https;
- this.crudMode = crudMode;
- }
-
- @Override
- public void before() {
- final Map> responses = new HashMap<>();
- mock = crudMode
- ? new CamelKMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), true)
- : new CamelKMockServer(https);
- mock.init();
- client = mock.createCamelKClient();
- }
-
- @Override
- public void after() {
- mock.destroy();
- client.close();
- }
-
-
- public CamelKClient getCamelKClient() {
- return client;
- }
-
-
- public MockServerExpectation expect() {
- return mock.expect();
- }
-
- @Deprecated
- public void expectAndReturnAsJson(String path, int code, T body) {
- expect().withPath(path).andReturn(code, body).always();
- }
-
- @Deprecated
- public void expectAndReturnAsString(String path, int code, String body) {
- expect().withPath(path).andReturn(code, body).always();
- }
-}
diff --git a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/EnableCamelKMockClient.java b/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/EnableCamelKMockClient.java
deleted file mode 100644
index bb7642fd5d8..00000000000
--- a/extensions/camel-k/mock/src/main/java/io/fabric8/camelk/mock/EnableCamelKMockClient.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.camelk.mock;
-
-import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient;
-import org.junit.jupiter.api.extension.ExtendWith;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * Annotation that is used for enabling CamelKMockServerExtension JUnit5 extension.
- * You may set here two parameters of `CamelKServer`: crudMode and https
- *
- * @deprecated use {@link EnableKubernetesMockClient} instead
- */
-@Deprecated
-@Target({ TYPE, METHOD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@ExtendWith(CamelKMockServerExtension.class)
-public @interface EnableCamelKMockClient {
-
- boolean https() default true;
-
- boolean crud() default false;
-}
diff --git a/extensions/camel-k/pom.xml b/extensions/camel-k/pom.xml
index e83569d6d90..7e4f799a14c 100755
--- a/extensions/camel-k/pom.xml
+++ b/extensions/camel-k/pom.xml
@@ -36,7 +36,6 @@
model-v1alpha1
model-v1
client
- mock
tests
diff --git a/extensions/certmanager/mock/pom.xml b/extensions/certmanager/mock/pom.xml
deleted file mode 100644
index ec1370328f9..00000000000
--- a/extensions/certmanager/mock/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- 4.0.0
-
- io.fabric8
- certmanager-extension-pom
- 6.2-SNAPSHOT
-
-
- certmanager-server-mock
- Fabric8 :: Cert Manager :: Server Mock
-
-
-
- io.fabric8
- kubernetes-server-mock
-
-
-
- io.fabric8
- certmanager-client
- ${project.version}
-
-
-
- org.junit.jupiter
- junit-jupiter-api
- provided
-
-
-
-
diff --git a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerMockServer.java b/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerMockServer.java
deleted file mode 100644
index a29e8b73f1c..00000000000
--- a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerMockServer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.certmanager.server.mock;
-
-import io.fabric8.certmanager.client.DefaultCertManagerClient;
-import io.fabric8.certmanager.client.NamespacedCertManagerClient;
-import io.fabric8.kubernetes.client.Config;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.Dispatcher;
-import okhttp3.mockwebserver.MockWebServer;
-
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * @deprecated use {@link KubernetesMockServer} instead
- */
-@Deprecated
-public class CertManagerMockServer extends KubernetesMockServer {
-
- public CertManagerMockServer() {
- super();
- }
-
- public CertManagerMockServer(boolean useHttps) {
- super(useHttps);
- }
-
- public CertManagerMockServer(Context context, MockWebServer server, Map> responses,
- Dispatcher dispatcher, boolean useHttps) {
- super(context, server, responses, dispatcher, useHttps);
- }
-
- @Override
- public String[] getRootPaths() {
- return new String[] { "/api", "/apis/cert-manager.io" };
- }
-
- public NamespacedCertManagerClient createCertManager() {
- Config config = getMockConfiguration();
- return new DefaultCertManagerClient(config);
- }
-}
diff --git a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerMockServerExtension.java b/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerMockServerExtension.java
deleted file mode 100644
index f7cab794eec..00000000000
--- a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerMockServerExtension.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package io.fabric8.certmanager.server.mock;
-
-
-import io.fabric8.certmanager.client.CertManagerClient;
-import io.fabric8.certmanager.client.NamespacedCertManagerClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServerExtension;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.MockWebServer;
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * The class that implements JUnit5 extension mechanism. You can use it directly in your JUnit test
- * by annotating it with @ExtendWith(CertManagerMockServerExtension.class)
or through
- * @EnableCertManagerMockClient
annotation
- */
-public class CertManagerMockServerExtension extends KubernetesMockServerExtension {
- private CertManagerMockServer certManagerMockServer;
- private NamespacedCertManagerClient certManagerClient;
-
- @Override
- protected void destroy() {
- certManagerMockServer.destroy();
- certManagerClient.close();
- }
-
- @Override
- protected Class> getClientType() {
- return CertManagerClient.class;
- }
-
- @Override
- protected Class> getKubernetesMockServerType() {
- return CertManagerMockServer.class;
- }
-
- @Override
- protected void initializeKubernetesClientAndMockServer(Class> testClass) {
- EnableCertManagerMockClient a = testClass.getAnnotation(EnableCertManagerMockClient.class);
- final Map> responses = new HashMap<>();
- certManagerMockServer = a.crud()
- ? new CertManagerMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), a.https())
- : new CertManagerMockServer(a.https());
- certManagerMockServer.init();
- certManagerClient = certManagerMockServer.createCertManager();
- }
-
- @Override
- protected void setFieldIfKubernetesClientOrMockServer(ExtensionContext context, boolean isStatic, Field field) throws IllegalAccessException {
- setFieldIfEqualsToProvidedType(context, isStatic, field, getClientType(), (i, f) -> f.set(i, certManagerClient));
- setFieldIfEqualsToProvidedType(context, isStatic, field, getKubernetesMockServerType(), (i, f) -> f.set(i, certManagerMockServer));
- }
-}
-
diff --git a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerServer.java b/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerServer.java
deleted file mode 100644
index 0d5d62b0e27..00000000000
--- a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/CertManagerServer.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.certmanager.server.mock;
-
-import io.fabric8.certmanager.client.CertManagerClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import io.fabric8.mockwebserver.dsl.MockServerExpectation;
-import okhttp3.mockwebserver.MockWebServer;
-import org.junit.rules.ExternalResource;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-public class CertManagerServer extends ExternalResource {
-
- protected CertManagerMockServer mock;
- private CertManagerClient client;
-
- private final boolean https;
- // In this mode the mock web server will store, read, update and delete
- // kubernetes resources using an in memory map and will appear as a real api
- // server.
- private final boolean crudMode;
-
- public CertManagerServer() {
- this(true, false);
- }
-
- public CertManagerServer(boolean https) {
- this(https, false);
- }
-
- public CertManagerServer(boolean https, boolean crudMode) {
- this.https = https;
- this.crudMode = crudMode;
- }
-
- @Override
- public void before() {
- final Map> responses = new HashMap<>();
- mock = crudMode
- ? new CertManagerMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), true)
- : new CertManagerMockServer(https);
- mock.init();
- client = mock.createCertManager();
- }
-
- @Override
- public void after() {
- mock.destroy();
- client.close();
- }
-
-
- public CertManagerClient getCertManagerClient() {
- return client;
- }
-
-
- public MockServerExpectation expect() {
- return mock.expect();
- }
-}
diff --git a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/EnableCertManagerMockClient.java b/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/EnableCertManagerMockClient.java
deleted file mode 100644
index ee51a99644b..00000000000
--- a/extensions/certmanager/mock/src/main/java/io/fabric8/certmanager/server/mock/EnableCertManagerMockClient.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.certmanager.server.mock;
-
-import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient;
-import org.junit.jupiter.api.extension.ExtendWith;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * Annotation that is used for enabling CertManagerMockServerExtension JUnit5 extension.
- * You may set here two parameters of `CertManagerKServer`: crudMode and https
- *
- * @deprecated use {@link EnableKubernetesMockClient} instead
- */
-@Deprecated
-@Target({ TYPE, METHOD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@ExtendWith(CertManagerMockServerExtension.class)
-public @interface EnableCertManagerMockClient {
-
- boolean https() default true;
-
- boolean crud() default false;
-}
diff --git a/extensions/certmanager/pom.xml b/extensions/certmanager/pom.xml
index adc7d83d6a2..fb16b6c39a6 100644
--- a/extensions/certmanager/pom.xml
+++ b/extensions/certmanager/pom.xml
@@ -38,7 +38,6 @@
model-v1beta1
model-v1
client
- mock
examples
tests
diff --git a/extensions/chaosmesh/mock/pom.xml b/extensions/chaosmesh/mock/pom.xml
deleted file mode 100644
index f1221cf50cb..00000000000
--- a/extensions/chaosmesh/mock/pom.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
- 4.0.0
-
- io.fabric8
- chaosmesh
- 6.2-SNAPSHOT
-
-
- chaosmesh-server-mock
- Fabric8 :: Chaos Mesh :: Server Mock
-
-
-
- io.fabric8
- kubernetes-server-mock
-
-
-
- io.fabric8
- chaosmesh-client
- ${project.version}
-
-
-
- org.junit.jupiter
- junit-jupiter-api
- provided
-
-
-
-
diff --git a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshMockServer.java b/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshMockServer.java
deleted file mode 100644
index 38221453460..00000000000
--- a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshMockServer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.chaosmesh.server.mock;
-
-import io.fabric8.chaosmesh.client.DefaultChaosMeshClient;
-import io.fabric8.chaosmesh.client.NamespacedChaosMeshClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.Dispatcher;
-import okhttp3.mockwebserver.MockWebServer;
-
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * @deprecated use {@link KubernetesMockServer} instead
- */
-@Deprecated
-public class ChaosMeshMockServer extends KubernetesMockServer {
- public ChaosMeshMockServer() {
- super();
- }
-
- public ChaosMeshMockServer(boolean useHttps) {
- super(useHttps);
- }
-
- public ChaosMeshMockServer(Context context, MockWebServer server, Map> responses,
- Dispatcher dispatcher, boolean useHttps) {
- super(context, server, responses, dispatcher, useHttps);
- }
-
- @Override
- public String[] getRootPaths() {
- return new String[] { "/api", "/apis/chaos-mesh.org" };
- }
-
- public NamespacedChaosMeshClient createChaosMeshClient() {
- return new DefaultChaosMeshClient(getMockConfiguration());
- }
-}
diff --git a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshMockServerExtension.java b/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshMockServerExtension.java
deleted file mode 100644
index e787a4fb670..00000000000
--- a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshMockServerExtension.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package io.fabric8.chaosmesh.server.mock;
-
-
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServerExtension;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.chaosmesh.client.NamespacedChaosMeshClient;
-import io.fabric8.chaosmesh.client.ChaosMeshClient;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.MockWebServer;
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * The class that implements JUnit5 extension mechanism. You can use it directly in your JUnit test
- * by annotating it with @ExtendWith(OpenShiftMockServerExtension.class)
or through
- * @EnableOpenShiftMockClient
annotation
- */
-public class ChaosMeshMockServerExtension extends KubernetesMockServerExtension {
- private ChaosMeshMockServer chaosMeshMockServer;
- private NamespacedChaosMeshClient chaosMeshClient;
-
- @Override
- protected void destroy() {
- chaosMeshMockServer.destroy();
- chaosMeshClient.close();
- }
-
- @Override
- protected Class> getClientType() {
- return ChaosMeshClient.class;
- }
-
- @Override
- protected Class> getKubernetesMockServerType() {
- return ChaosMeshMockServer.class;
- }
-
- @Override
- protected void initializeKubernetesClientAndMockServer(Class> testClass) {
- EnableChaosMeshMockClient a = testClass.getAnnotation(EnableChaosMeshMockClient.class);
- final Map> responses = new HashMap<>();
- chaosMeshMockServer = a.crud()
- ? new ChaosMeshMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), a.https())
- : new ChaosMeshMockServer(a.https());
- chaosMeshMockServer.init();
- chaosMeshClient = chaosMeshMockServer.createChaosMeshClient();
- }
-
- @Override
- protected void setFieldIfKubernetesClientOrMockServer(ExtensionContext context, boolean isStatic, Field field) throws IllegalAccessException {
- setFieldIfEqualsToProvidedType(context, isStatic, field, getClientType(), (i, f) -> f.set(i, chaosMeshClient));
- setFieldIfEqualsToProvidedType(context, isStatic, field, getKubernetesMockServerType(), (i, f) -> f.set(i, chaosMeshMockServer));
- }
-}
-
diff --git a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshServer.java b/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshServer.java
deleted file mode 100644
index 59acd2ffdfc..00000000000
--- a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/ChaosMeshServer.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.chaosmesh.server.mock;
-
-import io.fabric8.chaosmesh.client.ChaosMeshClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import io.fabric8.mockwebserver.dsl.MockServerExpectation;
-import okhttp3.mockwebserver.MockWebServer;
-import org.junit.rules.ExternalResource;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-public class ChaosMeshServer extends ExternalResource {
-
- protected ChaosMeshMockServer mock;
- private ChaosMeshClient client;
-
- private final boolean https;
- private final boolean crudMode;
-
- public ChaosMeshServer() {
- this(true, false);
- }
-
- public ChaosMeshServer(boolean https) {
- this(https, false);
- }
-
- public ChaosMeshServer(boolean https, boolean crudMode) {
- this.https = https;
- this.crudMode = crudMode;
- }
-
- @Override
- public void before() {
- final Map> responses = new HashMap<>();
- mock = crudMode
- ? new ChaosMeshMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), true)
- : new ChaosMeshMockServer(https);
- mock.init();
- client = mock.createChaosMeshClient();
- }
-
- @Override
- public void after() {
- mock.destroy();
- client.close();
- }
-
- public ChaosMeshClient get() {
- return client;
- }
-
- public MockServerExpectation expect() {
- return mock.expect();
- }
-}
diff --git a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/EnableChaosMeshMockClient.java b/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/EnableChaosMeshMockClient.java
deleted file mode 100644
index 369f68cfff3..00000000000
--- a/extensions/chaosmesh/mock/src/main/java/io/fabric8/chaosmesh/server/mock/EnableChaosMeshMockClient.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.fabric8.chaosmesh.server.mock;
-
-import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient;
-import org.junit.jupiter.api.extension.ExtendWith;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * Annotation that is used for enabling ChaoMeshMockServerExtension JUnit5 extension.
- * You may set here two parameters of `ChaosMeshServer`: crudMode and https
- *
- * @deprecated use {@link EnableKubernetesMockClient} instead
- */
-@Deprecated
-@Target({ TYPE, METHOD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@ExtendWith(ChaosMeshMockServerExtension.class)
-public @interface EnableChaosMeshMockClient {
-
- boolean https() default true;
-
- boolean crud() default false;
-}
diff --git a/extensions/chaosmesh/pom.xml b/extensions/chaosmesh/pom.xml
index 6f453835380..92a69007ae9 100644
--- a/extensions/chaosmesh/pom.xml
+++ b/extensions/chaosmesh/pom.xml
@@ -36,7 +36,6 @@
model
client
- mock
examples
tests
diff --git a/extensions/chaosmesh/tests/src/test/java/io/fabric8/chaosmesh/test/crud/IoChaosTest.java b/extensions/chaosmesh/tests/src/test/java/io/fabric8/chaosmesh/test/crud/IoChaosTest.java
index 010429bfdd0..a3ebced3ddb 100644
--- a/extensions/chaosmesh/tests/src/test/java/io/fabric8/chaosmesh/test/crud/IoChaosTest.java
+++ b/extensions/chaosmesh/tests/src/test/java/io/fabric8/chaosmesh/test/crud/IoChaosTest.java
@@ -25,7 +25,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
@EnableKubernetesMockClient(crud = true)
class IOChaosTest {
@@ -77,7 +76,7 @@ void testCrud() {
assertEquals("true", client.ioChaos().withName("latency").get().getMetadata().getLabels().get("updated"));
//Delete
- assertTrue(client.ioChaos().withName("latency").delete().size() == 1);
+ assertEquals(1, client.ioChaos().withName("latency").delete().size());
assertNull(client.ioChaos().withName("latency").get());
}
}
diff --git a/extensions/istio/mock/pom.xml b/extensions/istio/mock/pom.xml
deleted file mode 100644
index c64525adfb8..00000000000
--- a/extensions/istio/mock/pom.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
- 4.0.0
-
- io.fabric8
- istio-extension-pom
- 6.2-SNAPSHOT
-
-
- istio-server-mock
- Fabric8 :: Istio :: Server Mock
-
-
-
- io.fabric8
- kubernetes-server-mock
-
-
-
- io.fabric8
- istio-client
-
-
-
- org.junit.jupiter
- junit-jupiter-api
- provided
-
-
-
-
diff --git a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/EnableIstioMockClient.java b/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/EnableIstioMockClient.java
deleted file mode 100644
index 3b5f70f98b4..00000000000
--- a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/EnableIstioMockClient.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.istio.mock;
-
-import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient;
-import org.junit.jupiter.api.extension.ExtendWith;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * Annotation that is used for enabling IstioMockServerExtension JUnit5 extension.
- * You may set here two parameters of `IstioServer`: crudMode and https
- *
- * @deprecated use {@link EnableKubernetesMockClient} instead
- */
-@Deprecated
-@Target({ TYPE, METHOD, ANNOTATION_TYPE })
-@Retention(RUNTIME)
-@ExtendWith(IstioMockServerExtension.class)
-public @interface EnableIstioMockClient {
-
- boolean https() default true;
-
- boolean crud() default false;
-}
diff --git a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioMockServer.java b/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioMockServer.java
deleted file mode 100644
index 95b2f4b8a76..00000000000
--- a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioMockServer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.istio.mock;
-
-import io.fabric8.istio.client.DefaultIstioClient;
-import io.fabric8.istio.client.NamespacedIstioClient;
-import io.fabric8.kubernetes.client.Config;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.Dispatcher;
-import okhttp3.mockwebserver.MockWebServer;
-
-import java.util.Map;
-import java.util.Queue;
-
-/**
- * @deprecated use {@link KubernetesMockServer} instead
- */
-@Deprecated
-public class IstioMockServer extends KubernetesMockServer {
- public IstioMockServer() {
- super();
- }
-
- public IstioMockServer(boolean useHttps) {
- super(useHttps);
- }
-
- public IstioMockServer(Context context, MockWebServer server, Map> responses,
- Dispatcher dispatcher, boolean useHttps) {
- super(context, server, responses, dispatcher, useHttps);
- }
-
- @Override
- public String[] getRootPaths() {
- return new String[] { "/api", "/apis/networking.istio.io", "/apis/security.istio.io", "/apis/operator.istio.io" };
- }
-
- public NamespacedIstioClient createIstio() {
- Config config = getMockConfiguration();
- return new DefaultIstioClient(config);
- }
-}
diff --git a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioMockServerExtension.java b/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioMockServerExtension.java
deleted file mode 100644
index 1e06500106e..00000000000
--- a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioMockServerExtension.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.istio.mock;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-import org.junit.jupiter.api.extension.ExtensionContext;
-
-import io.fabric8.istio.client.IstioClient;
-import io.fabric8.istio.client.NamespacedIstioClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMockServerExtension;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import okhttp3.mockwebserver.MockWebServer;
-
-/**
- * The class that implements JUnit5 extension mechanism. You can use it directly in your JUnit test
- * by annotating it with @ExtendWith(KnativeMockServerExtension.class)
or through
- * @EnableKnativeMockClient
annotation
- */
-public class IstioMockServerExtension extends KubernetesMockServerExtension {
- private IstioMockServer mockServer;
- private NamespacedIstioClient istioClient;
-
- @Override
- protected void destroy() {
- mockServer.destroy();
- istioClient.close();
- }
-
- @Override
- protected Class> getClientType() {
- return IstioClient.class;
- }
-
- @Override
- protected Class> getKubernetesMockServerType() {
- return IstioMockServer.class;
- }
-
- @Override
- protected void initializeKubernetesClientAndMockServer(Class> testClass) {
- EnableIstioMockClient a = testClass.getAnnotation(EnableIstioMockClient.class);
- final Map> responses = new HashMap<>();
- mockServer = a.crud()
- ? new IstioMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), a.https())
- : new IstioMockServer(a.https());
- mockServer.init();
- istioClient = mockServer.createIstio();
- }
-
- @Override
- protected void setFieldIfKubernetesClientOrMockServer(ExtensionContext context, boolean isStatic, Field field) throws IllegalAccessException {
- setFieldIfEqualsToProvidedType(context, isStatic, field, getClientType(), (i, f) -> f.set(i, istioClient));
- setFieldIfEqualsToProvidedType(context, isStatic, field, getKubernetesMockServerType(), (i, f) -> f.set(i, mockServer));
- }
-}
diff --git a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioServer.java b/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioServer.java
deleted file mode 100644
index a9521b9fa79..00000000000
--- a/extensions/istio/mock/src/main/java/io/fabric8/istio/mock/IstioServer.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Copyright (C) 2015 Red Hat, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.fabric8.istio.mock;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-
-import org.junit.rules.ExternalResource;
-
-import io.fabric8.istio.client.IstioClient;
-import io.fabric8.kubernetes.client.server.mock.KubernetesMixedDispatcher;
-import io.fabric8.mockwebserver.Context;
-import io.fabric8.mockwebserver.ServerRequest;
-import io.fabric8.mockwebserver.ServerResponse;
-import io.fabric8.mockwebserver.dsl.MockServerExpectation;
-import okhttp3.mockwebserver.MockWebServer;
-
-public class IstioServer extends ExternalResource {
-
- protected IstioMockServer mock;
- private IstioClient client;
-
- private final boolean https;
- // In this mode the mock web server will store, read, update and delete
- // kubernetes resources using an in memory map and will appear as a real api
- // server.
- private final boolean crudMode;
-
- public IstioServer() {
- this(true, false);
- }
-
- public IstioServer(boolean https) {
- this(https, false);
- }
-
- public IstioServer(boolean https, boolean crudMode) {
- this.https = https;
- this.crudMode = crudMode;
- }
-
- @Override
- public void before() {
- final Map> responses = new HashMap<>();
- mock = crudMode
- ? new IstioMockServer(new Context(), new MockWebServer(), responses, new KubernetesMixedDispatcher(responses), true)
- : new IstioMockServer(https);
- mock.init();
- client = mock.createIstio();
- }
-
- @Override
- public void after() {
- mock.destroy();
- client.close();
- }
-
- public IstioClient getIstioClient() {
- return client;
- }
-
- public MockServerExpectation expect() {
- return mock.expect();
- }
-}
diff --git a/extensions/istio/pom.xml b/extensions/istio/pom.xml
index 4d9b247c0bd..ddbd9ad4086 100755
--- a/extensions/istio/pom.xml
+++ b/extensions/istio/pom.xml
@@ -36,7 +36,6 @@
model-v1alpha3
model-v1beta1
client
- mock
examples
tests
diff --git a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/DestinationRuleTest.java b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/DestinationRuleTest.java
index 52142ac454e..7684e0f767f 100644
--- a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/DestinationRuleTest.java
+++ b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/DestinationRuleTest.java
@@ -31,10 +31,10 @@
/**
* @author Christophe Laprun
*/
-public class DestinationRuleTest {
+class DestinationRuleTest {
@Test
- public void loadingFromYAMLIssue82ShouldWork() throws Exception {
+ void loadingFromYAMLIssue82ShouldWork() throws Exception {
final InputStream inputStream = DestinationRuleTest.class.getResourceAsStream("/v1alpha3/destination-rule-issue82.yaml");
final DestinationRule destinationRule = Serialization.yamlMapper().readValue(inputStream, DestinationRule.class);
diff --git a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/EnvoyFilterTest.java b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/EnvoyFilterTest.java
index dd8567da3a8..db4aa1775bc 100644
--- a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/EnvoyFilterTest.java
+++ b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/EnvoyFilterTest.java
@@ -25,15 +25,15 @@
import java.io.InputStream;
import java.util.Map;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author Christophe Laprun
*/
-public class EnvoyFilterTest {
+class EnvoyFilterTest {
@Test
- public void loadingFromYAMLIssue99ShouldWork() throws Exception {
+ void loadingFromYAMLIssue99ShouldWork() throws Exception {
final InputStream inputStream = EnvoyFilterTest.class.getResourceAsStream("/v1alpha3/envoy-filter-issue99.yaml");
final EnvoyFilter filter = Serialization.yamlMapper().readValue(inputStream, EnvoyFilter.class);
diff --git a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/VirtualServiceTest.java b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/VirtualServiceTest.java
index 083bfff93ef..114c3df27e6 100644
--- a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/VirtualServiceTest.java
+++ b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1alpha3/VirtualServiceTest.java
@@ -25,12 +25,12 @@
import java.io.InputStream;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
-public class VirtualServiceTest {
+class VirtualServiceTest {
@Test
- public void roundtripBasicVirtualServiceShouldWork() throws Exception {
+ void roundtripBasicVirtualServiceShouldWork() throws Exception {
final String apiVersion = "networking.istio.io/v1alpha3";
final VirtualService virtualService = new VirtualServiceBuilder().withApiVersion(apiVersion)
.withNewMetadata().withName("vs_name").withNamespace("ns").endMetadata()
@@ -55,7 +55,7 @@ public void roundtripBasicVirtualServiceShouldWork() throws Exception {
}
@Test
- public void loadingFromYAMLIssue103ShouldWork() throws Exception {
+ void loadingFromYAMLIssue103ShouldWork() throws Exception {
final InputStream inputStream = VirtualServiceTest.class.getResourceAsStream("/v1alpha3/virtual-service-issue103.yaml");
final VirtualService virtualService = Serialization.yamlMapper().readValue(inputStream, VirtualService.class);
@@ -76,7 +76,7 @@ public void loadingFromYAMLIssue103ShouldWork() throws Exception {
}
@Test
- public void loadingVirtualServiceWithValidationMessages() throws Exception {
+ void loadingVirtualServiceWithValidationMessages() throws Exception {
final InputStream inputStream = VirtualServiceTest.class.getResourceAsStream("/v1alpha3/virtual-service-issue4315.yaml");
final VirtualService virtualService = Serialization.yamlMapper().readValue(inputStream, VirtualService.class);
assertEquals(3, virtualService.getStatus().getValidationMessages().size());
diff --git a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/CorsPolicyTest.java b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/CorsPolicyTest.java
index 33d83dd72e6..f34d694668b 100644
--- a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/CorsPolicyTest.java
+++ b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/CorsPolicyTest.java
@@ -22,15 +22,15 @@
import io.fabric8.kubernetes.client.utils.Serialization;
import org.junit.jupiter.api.Test;
-import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
/**
* @author Christophe Laprun
*/
-public class CorsPolicyTest {
+class CorsPolicyTest {
@Test
- public void roundtripShouldWork() throws Exception {
+ void roundtripShouldWork() throws Exception {
final String prefix = "example.com";
final String allowOrigin = "bar.com";
final CorsPolicy policy = new CorsPolicyBuilder()
diff --git a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/GatewayTest.java b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/GatewayTest.java
index 259e68aa737..5b9756a5a85 100644
--- a/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/GatewayTest.java
+++ b/extensions/istio/tests/src/test/java/io/fabric8/istio/test/v1beta1/GatewayTest.java
@@ -26,7 +26,6 @@
import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer;
import io.fabric8.kubernetes.client.utils.Serialization;
import okhttp3.mockwebserver.RecordedRequest;
-import org.junit.Assert;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.Yaml;
@@ -127,7 +126,7 @@ void testDeleteOrphan() throws InterruptedException {
}
@Test
- public void checkBasicGateway() throws Exception {
+ void checkBasicGateway() throws Exception {
final Gateway gateway = new GatewayBuilder()
.withNewMetadata()
.withName("httpbin-gateway")
@@ -146,45 +145,45 @@ public void checkBasicGateway() throws Exception {
Yaml parser = new Yaml();
final Map reloaded = parser.loadAs(output, Map.class);
- Assert.assertEquals("Gateway", reloaded.get("kind"));
+ assertEquals("Gateway", reloaded.get("kind"));
final Map metadata = (Map) reloaded.get("metadata");
- Assert.assertNotNull(metadata);
- Assert.assertEquals("httpbin-gateway", metadata.get("name"));
+ assertNotNull(metadata);
+ assertEquals("httpbin-gateway", metadata.get("name"));
final Map spec = (Map) reloaded.get("spec");
- Assert.assertNotNull(spec);
+ assertNotNull(spec);
final Map selector = spec.get("selector");
- Assert.assertNotNull(selector);
- Assert.assertEquals("ingressgateway", selector.get("istio"));
+ assertNotNull(selector);
+ assertEquals("ingressgateway", selector.get("istio"));
final List