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