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);
}
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);
}
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);
}
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);
}
Aggregations