Search in sources :

Example 16 with RouteServerResolver

use of org.eclipse.che.workspace.infrastructure.openshift.server.RouteServerResolver in project devspaces-images by redhat-developer.

the class RouteServerResolverTest method testResolvingServersWhenThereIsMatchedRouteForMachineAndServerPathIsRelative.

@Test
public void testResolvingServersWhenThereIsMatchedRouteForMachineAndServerPathIsRelative() {
    Route route = createRoute("matched", "machine", singletonMap("http-server", new ServerConfigImpl("3054", "http", "api", ATTRIBUTES_MAP)));
    RouteServerResolver serverResolver = new RouteServerResolver(emptyList(), singletonList(route));
    Map<String, ServerImpl> resolved = serverResolver.resolve("machine");
    assertEquals(resolved.size(), 1);
    assertEquals(resolved.get("http-server"), new ServerImpl().withUrl("http://localhost/api").withStatus(UNKNOWN).withAttributes(defaultAttributeAnd(Constants.SERVER_PORT_ATTRIBUTE, "3054", ServerConfig.ENDPOINT_ORIGIN, "/")));
}
Also used : ServerImpl(org.eclipse.che.api.workspace.server.model.impl.ServerImpl) RouteServerResolver(org.eclipse.che.workspace.infrastructure.openshift.server.RouteServerResolver) ServerConfigImpl(org.eclipse.che.api.workspace.server.model.impl.ServerConfigImpl) Route(io.fabric8.openshift.api.model.Route) Test(org.testng.annotations.Test)

Aggregations

Route (io.fabric8.openshift.api.model.Route)16 ServerConfigImpl (org.eclipse.che.api.workspace.server.model.impl.ServerConfigImpl)16 ServerImpl (org.eclipse.che.api.workspace.server.model.impl.ServerImpl)16 RouteServerResolver (org.eclipse.che.workspace.infrastructure.openshift.server.RouteServerResolver)16 Test (org.testng.annotations.Test)16 Service (io.fabric8.kubernetes.api.model.Service)6 RouteBuilder (io.fabric8.openshift.api.model.RouteBuilder)2