RawCustomResourceOperationsImpl extends OperationSupport { protected HttpUrl.Builder fetchWatchUrl(String namespace, String name, Map<String, String> labels, ListOptions options) throws MalformedURLException { String resourceUrl = fetchUrl(namespace, null, labels); if (resourceUrl.endsWith("/")) { resourceUrl = resourceUrl.substring(0, resourceUrl.length() - 1); } URL url = new URL(resourceUrl); HttpUrl.Builder httpUrlBuilder = HttpUrl.get(url).newBuilder(); if (name != null) { httpUrlBuilder.addQueryParameter("fieldSelector", "metadata.name=" + name); } HttpClientUtils.appendListOptionParams(httpUrlBuilder, options); return httpUrlBuilder; } RawCustomResourceOperationsImpl(OkHttpClient client, Config config, CustomResourceDefinitionContext customResourceDefinition); Map<String, Object> load(InputStream fileInputStream); Map<String, Object> load(String objectAsJsonString); Map<String, Object> create(String objectAsString); Map<String, Object> create(Map<String, Object> object); Map<String, Object> create(String namespace, String objectAsString); Map<String, Object> create(InputStream objectAsStream); Map<String, Object> create(String namespace, InputStream objectAsStream); Map<String, Object> create(String namespace, Map<String, Object> object); Map<String, Object> createOrReplace(String objectAsString); Map<String, Object> createOrReplace(Map<String, Object> customResourceObject); Map<String, Object> createOrReplace(InputStream inputStream); Map<String, Object> createOrReplace(String namespace, String objectAsString); Map<String, Object> createOrReplace(String namespace, Map<String, Object> customResourceObject); Map<String, Object> createOrReplace(String namespace, InputStream objectAsStream); Map<String, Object> edit(String name, Map<String, Object> object); Map<String, Object> edit(String name, String objectAsString); Map<String, Object> edit(String namespace, String name, Map<String, Object> object); Map<String, Object> edit(String namespace, String name, String objectAsString); Map<String, Object> edit(String name, InputStream objectAsStream); Map<String, Object> edit(String namespace, String name, InputStream objectAsStream); Map<String, Object> updateStatus(String name, Map<String, Object> objectAsMap); Map<String, Object> updateStatus(String name, String objectAsJsonString); Map<String, Object> updateStatus(String namespace, String name, Map<String, Object> objectAsMap); Map<String, Object> updateStatus(String name, InputStream objectAsStream); Map<String, Object> updateStatus(String namespace, String name, InputStream objectAsStream); Map<String, Object> updateStatus(String namespace, String name, String objectAsJsonString); Map<String, Object> get(String name); Map<String, Object> get(String namespace, String name); Map<String, Object> list(); Map<String, Object> list(String namespace); Map<String, Object> list(String namespace, Map<String, String> labels); Map<String, Object> delete(String namespace); Map<String, Object> delete(String namespace, boolean cascading); Map<String, Object> delete(String namespace, DeleteOptions deleteOptions); Map<String, Object> delete(String namespace, String name); Map<String, Object> delete(String namespace, String name, boolean cascading); Map<String, Object> delete(String namespace, String name, String propagationPolicy); Map<String, Object> delete(String namespace, String name, DeleteOptions deleteOptions); void watch(String namespace, Watcher<String> watcher); void watch(String namespace, String resourceVersion, Watcher<String> watcher); void watch(String namespace, ListOptions options, Watcher<String> watcher); void watch(Watcher<String> watcher); Watch watch(String namespace, String name, Map<String, String> labels, String resourceVersion, Watcher<String> watcher); Watch watch(String namespace, String name, Map<String, String> labels, ListOptions options, Watcher<String> watcher);  }
@Test public void testFetchWatchUrlWithNamespace() throws MalformedURLException { RawCustomResourceOperationsImpl rawCustomResourceOperations = new RawCustomResourceOperationsImpl(mockClient, config, customResourceDefinitionContext); HttpUrl url = rawCustomResourceOperations.fetchWatchUrl("test", null, null, new ListOptionsBuilder().withWatch(true).build()).build(); assertEquals("https: }
@Test public void testFetchWatchUrlWithNamespaceAndName() throws MalformedURLException { RawCustomResourceOperationsImpl rawCustomResourceOperations = new RawCustomResourceOperationsImpl(mockClient, config, customResourceDefinitionContext); HttpUrl url = rawCustomResourceOperations.fetchWatchUrl("test", "example-resource", null, new ListOptionsBuilder().withWatch(true).build()).build(); assertEquals("https: }
@Test public void testFetchWatchUrlWithNamespaceAndNameAndResourceVersion() throws MalformedURLException { RawCustomResourceOperationsImpl rawCustomResourceOperations = new RawCustomResourceOperationsImpl(mockClient, config, customResourceDefinitionContext); HttpUrl url = rawCustomResourceOperations.fetchWatchUrl("test", "example-resource", null, new ListOptionsBuilder().withResourceVersion("100069").withWatch(true).build()).build(); assertEquals("https: }
@Test public void testFetchWatchUrlWithoutAnything() throws MalformedURLException { RawCustomResourceOperationsImpl rawCustomResourceOperations = new RawCustomResourceOperationsImpl(mockClient, config, customResourceDefinitionContext); HttpUrl url = rawCustomResourceOperations.fetchWatchUrl(null, null, null, new ListOptionsBuilder().withWatch(true).build()).build(); assertEquals("https: }
@Test public void testFetchWatchUrlWithLabels() throws MalformedURLException { RawCustomResourceOperationsImpl rawCustomResourceOperations = new RawCustomResourceOperationsImpl(mockClient, config, customResourceDefinitionContext); Map<String, String> labels = new HashMap<>(); labels.put("foo", "bar"); labels.put("foo1", "bar1"); HttpUrl url = rawCustomResourceOperations.fetchWatchUrl(null, null, labels, new ListOptionsBuilder().withWatch(true).build()).build(); assertEquals("https: }
@Test public void testFetchWatchUrlWithLabelsWithNamespace() throws MalformedURLException { RawCustomResourceOperationsImpl rawCustomResourceOperations = new RawCustomResourceOperationsImpl(mockClient, config, customResourceDefinitionContext); Map<String, String> labels = new HashMap<>(); labels.put("foo", "bar"); labels.put("foo1", "bar1"); HttpUrl url = rawCustomResourceOperations.fetchWatchUrl("test", null, labels, new ListOptionsBuilder().withWatch(true).build()).build(); assertEquals("https: }