@Test void getAttachedDistroXClusterNames() { when(distroXEndpoint.list(any(), anyString())).thenReturn(new StackViewV4Responses()); environmentResourceDeletionServiceUnderTest.getAttachedDistroXClusterNames(environment); verify(distroXEndpoint).list(isNull(), eq(ENVIRONMENT_CRN)); }
Set<String> getAttachedDistroXClusterNames(Environment environment) { Set<String> clusterNames = new HashSet<>(); LOGGER.debug("Get DistroX clusters of the environment: '{}'", environment.getName()); try { Set<String> distroXClusterNames = distroXV1Endpoint .list(null, environment.getResourceCrn()) .getResponses() .stream() .map(StackViewV4Response::getName) .collect(Collectors.toSet()); clusterNames.addAll(distroXClusterNames); } catch (WebApplicationException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } catch (ProcessingException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } return clusterNames; }
EnvironmentResourceDeletionService { Set<String> getAttachedDistroXClusterNames(Environment environment) { Set<String> clusterNames = new HashSet<>(); LOGGER.debug("Get DistroX clusters of the environment: '{}'", environment.getName()); try { Set<String> distroXClusterNames = distroXV1Endpoint .list(null, environment.getResourceCrn()) .getResponses() .stream() .map(StackViewV4Response::getName) .collect(Collectors.toSet()); clusterNames.addAll(distroXClusterNames); } catch (WebApplicationException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } catch (ProcessingException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } return clusterNames; } }
EnvironmentResourceDeletionService { Set<String> getAttachedDistroXClusterNames(Environment environment) { Set<String> clusterNames = new HashSet<>(); LOGGER.debug("Get DistroX clusters of the environment: '{}'", environment.getName()); try { Set<String> distroXClusterNames = distroXV1Endpoint .list(null, environment.getResourceCrn()) .getResponses() .stream() .map(StackViewV4Response::getName) .collect(Collectors.toSet()); clusterNames.addAll(distroXClusterNames); } catch (WebApplicationException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } catch (ProcessingException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } return clusterNames; } EnvironmentResourceDeletionService(SdxEndpoint sdxEndpoint, DatalakeV4Endpoint datalakeV4Endpoint, DistroXV1Endpoint distroXV1Endpoint,
            ClusterTemplateV4Endpoint clusterTemplateV4Endpoint); }
EnvironmentResourceDeletionService { Set<String> getAttachedDistroXClusterNames(Environment environment) { Set<String> clusterNames = new HashSet<>(); LOGGER.debug("Get DistroX clusters of the environment: '{}'", environment.getName()); try { Set<String> distroXClusterNames = distroXV1Endpoint .list(null, environment.getResourceCrn()) .getResponses() .stream() .map(StackViewV4Response::getName) .collect(Collectors.toSet()); clusterNames.addAll(distroXClusterNames); } catch (WebApplicationException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } catch (ProcessingException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } return clusterNames; } EnvironmentResourceDeletionService(SdxEndpoint sdxEndpoint, DatalakeV4Endpoint datalakeV4Endpoint, DistroXV1Endpoint distroXV1Endpoint,
            ClusterTemplateV4Endpoint clusterTemplateV4Endpoint); void deleteClusterDefinitionsOnCloudbreak(String environmentCrn); Set<String> getAttachedSdxClusterCrns(Environment environment); Set<String> getDatalakeClusterNames(Environment environment); }
EnvironmentResourceDeletionService { Set<String> getAttachedDistroXClusterNames(Environment environment) { Set<String> clusterNames = new HashSet<>(); LOGGER.debug("Get DistroX clusters of the environment: '{}'", environment.getName()); try { Set<String> distroXClusterNames = distroXV1Endpoint .list(null, environment.getResourceCrn()) .getResponses() .stream() .map(StackViewV4Response::getName) .collect(Collectors.toSet()); clusterNames.addAll(distroXClusterNames); } catch (WebApplicationException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } catch (ProcessingException e) { propagateException("Failed to get DistroX clusters from Cloudbreak service due to:", e); } return clusterNames; } EnvironmentResourceDeletionService(SdxEndpoint sdxEndpoint, DatalakeV4Endpoint datalakeV4Endpoint, DistroXV1Endpoint distroXV1Endpoint,
            ClusterTemplateV4Endpoint clusterTemplateV4Endpoint); void deleteClusterDefinitionsOnCloudbreak(String environmentCrn); Set<String> getAttachedSdxClusterCrns(Environment environment); Set<String> getDatalakeClusterNames(Environment environment);  }