KubeApiClients { static String mapUri(Request r) { String path = '/' + String.join("/", r.url().pathSegments()); return removeAll(INSTANCE_ID_PATTERN, removeAll(UUID_PATTERN, path)); }  static ApiClient createApiClient(String metricsNamePrefix,
                                            TitusRuntime titusRuntime,
                                            long readTimeoutMs); static ApiClient createApiClient(String kubeApiServerUrl,
                                            String kubeConfigPath,
                                            String metricsNamePrefix,
                                            TitusRuntime titusRuntime,
                                            long readTimeoutMs); static ApiClient createApiClient(String kubeApiServerUrl,
                                            String kubeConfigPath,
                                            String metricsNamePrefix,
                                            TitusRuntime titusRuntime,
                                            Function<Request, String> uriMapper,
                                            long readTimeoutMs); static Optional<Throwable> checkKubeConnectivity(ApiClient apiClient); static ApiClient mustHaveKubeConnectivity(ApiClient apiClient); static SharedInformerFactory createSharedInformerFactory(String threadNamePrefix, ApiClient apiClient, TitusRuntime titusRuntime); static final Pattern UUID_PATTERN; static final Pattern INSTANCE_ID_PATTERN; }
@Test public void testMapUri() { String uuid = UUID.randomUUID().toString(); String instanceId = "i-07d1b67286b43458e"; String path = "/segment1_" + uuid + "/segment2_" + instanceId; assertThat(KubeApiClients.mapUri(newRequest(path))).isEqualTo("/segment1_/segment2_"); }