### Question:
AbstractApiDocService { protected void preparePath(N path, ApiDocPath<N> apiDocPath, ApiDocInfo apiDocInfo, String basePath, String originalEndpoint, String serviceId) { log.trace("Swagger Service Id: " + serviceId); log.trace("Original Endpoint: " + originalEndpoint); log.trace("Base Path: " + basePath); String endPoint = getEndPoint(basePath, originalEndpoint); RoutedService route = getRoutedServiceByApiInfo(apiDocInfo, endPoint); if (route == null) { route = apiDocInfo.getRoutes().getBestMatchingServiceUrl(endPoint, ServiceType.API); } if (route == null) { log.debug("Could not transform endpoint '{}' for service '{}'. Please check the service configuration.", endPoint, serviceId); } else { apiDocPath.addPrefix(route.getGatewayUrl()); } Pair<String, String> endPointPairs = getEndPointPairs(endPoint, serviceId, route); log.trace("Final Endpoint: " + endPointPairs.getRight()); apiDocPath.addShortPath(endPointPairs.getLeft(), path); apiDocPath.addLongPath(endPointPairs.getRight(), path); }  abstract String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo);  }### Answer:
@Test public void preparePath() { List<Server> servers = new ArrayList<>(); servers.add(0, new Server().url("/apicatalog")); ApiDocPath<PathItem> apiDocPath = new ApiDocPath<>(); OpenAPI openAPI = getDummyOpenApiObject(servers); String apiDocContent = convertOpenApiToJson(openAPI); RoutedService routedService = new RoutedService("api_v1", "api/v1", "/api/v1"); RoutedService routedService2 = new RoutedService("ui_v1", "ui/v1", "/ui/v1"); RoutedServices routedServices = new RoutedServices(); routedServices.addRoutedService(routedService); routedServices.addRoutedService(routedService2); ApiInfo apiInfo = new ApiInfo("org.zowe.apicatalog", "api/v1", null, "https: ApiDocInfo apiDocInfo = new ApiDocInfo(apiInfo, apiDocContent, routedServices); abstractApiDocService.preparePath(openAPI.getPaths(), apiDocPath, apiDocInfo, "/api/v1/api-doc", "/", "apicatalog"); assertThat(apiDocPath.getLongPaths(), hasKey("/api/v1/apicatalog/api-doc/")); assertThat(apiDocPath.getShortPaths(), hasKey("/api-doc/")); assertTrue(apiDocPath.getPrefixes().contains("api/v1")); }