use of io.fabric8.kubernetes.client.server.mock.KubernetesMockServer in project fabric8 by fabric8io.
the class KubernetesConfigAdminBridgeTest method testOr.
@Test
public void testOr() {
System.setProperty("fabric8.pid.filters", "appName=A;B");
KubernetesMockServer plainServer = new KubernetesMockServer(false);
plainServer.expect().get().withPath("/api/v1/namespaces/test/configmaps?labelSelector=karaf.pid,appName%20in%20(A,B)&watch=true").andReturnChunked(200).always();
plainServer.expect().get().withPath("/api/v1/namespaces/test/configmaps?labelSelector=karaf.pid,appName%20in%20(A,B)").andReturn(200, cmEmptyList).once();
KubernetesConfigAdminBridge kcab = new KubernetesConfigAdminBridge();
kcab.bindConfigAdmin(caService);
kcab.bindKubernetesClient(plainServer.createClient());
kcab.activate();
}
use of io.fabric8.kubernetes.client.server.mock.KubernetesMockServer in project flink by apache.
the class MixedKubernetesServer method before.
public void before() {
final HashMap<ServerRequest, Queue<ServerResponse>> response = new HashMap<>();
mock = crudMode ? new KubernetesMockServer(new Context(), mockWebServer, response, new MixedDispatcher(response), true) : new KubernetesMockServer(mockWebServer, response, https);
mock.init();
client = mock.createClient();
}
use of io.fabric8.kubernetes.client.server.mock.KubernetesMockServer in project fabric8 by fabric8io.
the class KubernetesConfigAdminBridgeTest method testAndOr.
@Test
public void testAndOr() {
System.setProperty("fabric8.pid.filters", "appName=A;B,database.name=my.oracle.datasource");
KubernetesMockServer plainServer = new KubernetesMockServer(false);
plainServer.expect().get().withPath("/api/v1/namespaces/test/configmaps?labelSelector=karaf.pid,appName%20in%20(A,B),database.name%20in%20(my.oracle.datasource)&watch=true").andReturnChunked(200).always();
plainServer.expect().get().withPath("/api/v1/namespaces/test/configmaps?labelSelector=karaf.pid,appName%20in%20(A,B),database.name%20in%20(my.oracle.datasource)").andReturn(200, cmEmptyList).once();
KubernetesConfigAdminBridge kcab = new KubernetesConfigAdminBridge();
kcab.bindConfigAdmin(caService);
kcab.bindKubernetesClient(plainServer.createClient());
kcab.activate();
}
use of io.fabric8.kubernetes.client.server.mock.KubernetesMockServer in project fabric8 by fabric8io.
the class KubernetesConfigAdminBridgeTest method testAand.
@Test
public void testAand() {
System.setProperty("fabric8.pid.filters", "appName=A,database.name=my.oracle.datasource");
KubernetesMockServer plainServer = new KubernetesMockServer(false);
plainServer.expect().get().withPath("/api/v1/namespaces/test/configmaps?labelSelector=karaf.pid,appName%20in%20(A),database.name%20in%20(my.oracle.datasource)&watch=true").andReturnChunked(200).always();
plainServer.expect().get().withPath("/api/v1/namespaces/test/configmaps?labelSelector=karaf.pid,appName%20in%20(A),database.name%20in%20(my.oracle.datasource)").andReturn(200, cmEmptyList).once();
KubernetesConfigAdminBridge kcab = new KubernetesConfigAdminBridge();
kcab.bindConfigAdmin(caService);
kcab.bindKubernetesClient(plainServer.createClient());
kcab.activate();
}
Aggregations