Search in sources :

Example 1 with RootPaths

use of io.fabric8.kubernetes.api.model.RootPaths in project fabric8-maven-plugin by fabric8io.

the class ClusterAccessTest method openshiftPlatformModeTest.

@Test
public void openshiftPlatformModeTest() throws Exception {
    paths.add("/oapi");
    paths.add("/oapi/v1");
    RootPaths rootpaths = new RootPaths();
    rootpaths.setPaths(paths);
    mockServer.expect().get().withPath("/").andReturn(200, rootpaths).always();
    ClusterAccess clusterAccess = new ClusterAccess(null, client);
    mode = clusterAccess.resolvePlatformMode(PlatformMode.openshift, logger);
    assertEquals(PlatformMode.openshift, mode);
    mode = clusterAccess.resolvePlatformMode(PlatformMode.DEFAULT, logger);
    assertEquals(PlatformMode.openshift, mode);
    mode = clusterAccess.resolvePlatformMode(null, logger);
    assertEquals(PlatformMode.openshift, mode);
}
Also used : RootPaths(io.fabric8.kubernetes.api.model.RootPaths) Test(org.junit.Test)

Example 2 with RootPaths

use of io.fabric8.kubernetes.api.model.RootPaths in project fabric8-maven-plugin by fabric8io.

the class ClusterAccessTest method createClientTestKubernetes.

@Test
public void createClientTestKubernetes() throws Exception {
    RootPaths rootpaths = new RootPaths();
    rootpaths.setPaths(paths);
    mockServer.expect().get().withPath("/").andReturn(200, rootpaths).always();
    ClusterAccess clusterAccess = new ClusterAccess(null, client);
    Client outputClient = clusterAccess.createDefaultClient(logger);
    assertTrue(outputClient instanceof KubernetesClient);
}
Also used : KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) RootPaths(io.fabric8.kubernetes.api.model.RootPaths) Client(io.fabric8.kubernetes.client.Client) OpenShiftClient(io.fabric8.openshift.client.OpenShiftClient) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) Test(org.junit.Test)

Example 3 with RootPaths

use of io.fabric8.kubernetes.api.model.RootPaths in project fabric8-maven-plugin by fabric8io.

the class ClusterAccessTest method kubernetesPlatformModeTest.

@Test
public void kubernetesPlatformModeTest() throws Exception {
    RootPaths rootpaths = new RootPaths();
    rootpaths.setPaths(paths);
    mockServer.expect().get().withPath("/").andReturn(200, rootpaths).always();
    ClusterAccess clusterAccess = new ClusterAccess(null, client);
    mode = clusterAccess.resolvePlatformMode(PlatformMode.kubernetes, logger);
    assertEquals(PlatformMode.kubernetes, mode);
    mode = clusterAccess.resolvePlatformMode(PlatformMode.DEFAULT, logger);
    assertEquals(PlatformMode.kubernetes, mode);
    mode = clusterAccess.resolvePlatformMode(null, logger);
    assertEquals(PlatformMode.kubernetes, mode);
}
Also used : RootPaths(io.fabric8.kubernetes.api.model.RootPaths) Test(org.junit.Test)

Example 4 with RootPaths

use of io.fabric8.kubernetes.api.model.RootPaths in project fabric8-maven-plugin by fabric8io.

the class ClusterAccessTest method createClientTestOpenshift.

@Test
public void createClientTestOpenshift() throws Exception {
    paths.add("/oapi");
    paths.add("/oapi/v1");
    RootPaths rootpaths = new RootPaths();
    rootpaths.setPaths(paths);
    mockServer.expect().get().withPath("/").andReturn(200, rootpaths).always();
    ClusterAccess clusterAccess = new ClusterAccess(null, client);
    Client outputClient = clusterAccess.createDefaultClient(logger);
    assertTrue(outputClient instanceof OpenShiftClient);
}
Also used : RootPaths(io.fabric8.kubernetes.api.model.RootPaths) OpenShiftClient(io.fabric8.openshift.client.OpenShiftClient) Client(io.fabric8.kubernetes.client.Client) OpenShiftClient(io.fabric8.openshift.client.OpenShiftClient) KubernetesClient(io.fabric8.kubernetes.client.KubernetesClient) Test(org.junit.Test)

Aggregations

RootPaths (io.fabric8.kubernetes.api.model.RootPaths)4 Test (org.junit.Test)4 Client (io.fabric8.kubernetes.client.Client)2 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)2 OpenShiftClient (io.fabric8.openshift.client.OpenShiftClient)2