@Test void deleteDatahubClustersForEnvironmentNoDatahubFound() { PollingConfig pollingConfig = PollingConfig.builder() .withSleepTime(0) .withSleepTimeUnit(TimeUnit.SECONDS) .withTimeout(0) .withTimeoutTimeUnit(TimeUnit.SECONDS) .build(); Environment environment = new Environment(); environment.setResourceCrn(ENV_CRN); StackViewV4Responses responses = new StackViewV4Responses(Set.of()); when(datahubService.list(anyString())).thenReturn(responses); underTest.deleteDatahubClustersForEnvironment(pollingConfig, environment, true); verify(datahubService, never()).deleteMultiple(anyString(), any(), anyBoolean()); }
public void deleteDatahubClustersForEnvironment(PollingConfig pollingConfig, Environment environment, boolean force) { Collection<StackViewV4Response> list = datahubService.list(environment.getResourceCrn()).getResponses(); LOGGER.info("Found {} Data Hub clusters for environment {}.", list.size(), environment.getName()); if (list.isEmpty()) { LOGGER.info("No Data Hub clusters found for environment."); } else { waitDatahubClustersDeletion(pollingConfig, environment, list, force); LOGGER.info("Data hub deletion finished."); } }
DatahubDeletionService { public void deleteDatahubClustersForEnvironment(PollingConfig pollingConfig, Environment environment, boolean force) { Collection<StackViewV4Response> list = datahubService.list(environment.getResourceCrn()).getResponses(); LOGGER.info("Found {} Data Hub clusters for environment {}.", list.size(), environment.getName()); if (list.isEmpty()) { LOGGER.info("No Data Hub clusters found for environment."); } else { waitDatahubClustersDeletion(pollingConfig, environment, list, force); LOGGER.info("Data hub deletion finished."); } } }
DatahubDeletionService { public void deleteDatahubClustersForEnvironment(PollingConfig pollingConfig, Environment environment, boolean force) { Collection<StackViewV4Response> list = datahubService.list(environment.getResourceCrn()).getResponses(); LOGGER.info("Found {} Data Hub clusters for environment {}.", list.size(), environment.getName()); if (list.isEmpty()) { LOGGER.info("No Data Hub clusters found for environment."); } else { waitDatahubClustersDeletion(pollingConfig, environment, list, force); LOGGER.info("Data hub deletion finished."); } } DatahubDeletionService(DatahubService datahubService); }
DatahubDeletionService { public void deleteDatahubClustersForEnvironment(PollingConfig pollingConfig, Environment environment, boolean force) { Collection<StackViewV4Response> list = datahubService.list(environment.getResourceCrn()).getResponses(); LOGGER.info("Found {} Data Hub clusters for environment {}.", list.size(), environment.getName()); if (list.isEmpty()) { LOGGER.info("No Data Hub clusters found for environment."); } else { waitDatahubClustersDeletion(pollingConfig, environment, list, force); LOGGER.info("Data hub deletion finished."); } } DatahubDeletionService(DatahubService datahubService); void deleteDatahubClustersForEnvironment(PollingConfig pollingConfig, Environment environment, boolean force); }
DatahubDeletionService { public void deleteDatahubClustersForEnvironment(PollingConfig pollingConfig, Environment environment, boolean force) { Collection<StackViewV4Response> list = datahubService.list(environment.getResourceCrn()).getResponses(); LOGGER.info("Found {} Data Hub clusters for environment {}.", list.size(), environment.getName()); if (list.isEmpty()) { LOGGER.info("No Data Hub clusters found for environment."); } else { waitDatahubClustersDeletion(pollingConfig, environment, list, force); LOGGER.info("Data hub deletion finished."); } } DatahubDeletionService(DatahubService datahubService); void deleteDatahubClustersForEnvironment(PollingConfig pollingConfig, Environment environment, boolean force);  }