@Test public void testCollectHostsToRemove() { HostGroup hostGroup = new HostGroup(); Set<String> hostNames = Collections.emptySet(); Map<String, InstanceMetaData> hosts = new HashMap<>(); when(clouderaManagerDecomissioner.collectHostsToRemove(stack, hostGroup, hostNames, apiClient)).thenReturn(hosts); Map<String, InstanceMetaData> actual = underTest.collectHostsToRemove(hostGroup, hostNames); assertEquals(hosts, actual); verify(clouderaManagerDecomissioner).collectHostsToRemove(stack, hostGroup, hostNames, apiClient); }
@Override public Map<String, InstanceMetaData> collectHostsToRemove(@Nonnull HostGroup hostGroup, Set<String> hostNames) { return clouderaManagerDecomissioner.collectHostsToRemove(stack, hostGroup, hostNames, client); }
ClouderaManagerClusterDecomissionService implements ClusterDecomissionService { @Override public Map<String, InstanceMetaData> collectHostsToRemove(@Nonnull HostGroup hostGroup, Set<String> hostNames) { return clouderaManagerDecomissioner.collectHostsToRemove(stack, hostGroup, hostNames, client); } }
ClouderaManagerClusterDecomissionService implements ClusterDecomissionService { @Override public Map<String, InstanceMetaData> collectHostsToRemove(@Nonnull HostGroup hostGroup, Set<String> hostNames) { return clouderaManagerDecomissioner.collectHostsToRemove(stack, hostGroup, hostNames, client); } ClouderaManagerClusterDecomissionService(Stack stack, HttpClientConfig clientConfig); }
ClouderaManagerClusterDecomissionService implements ClusterDecomissionService { @Override public Map<String, InstanceMetaData> collectHostsToRemove(@Nonnull HostGroup hostGroup, Set<String> hostNames) { return clouderaManagerDecomissioner.collectHostsToRemove(stack, hostGroup, hostNames, client); } ClouderaManagerClusterDecomissionService(Stack stack, HttpClientConfig clientConfig); @PostConstruct void initApiClient(); @Override void verifyNodesAreRemovable(Stack stack, Collection<InstanceMetaData> removableInstances); @Override Set<InstanceMetaData> collectDownscaleCandidates(@Nonnull HostGroup hostGroup, Integer scalingAdjustment, int defaultRootVolumeSize,
            Set<InstanceMetaData> instanceMetaDatasInStack); @Override Map<String, InstanceMetaData> collectHostsToRemove(@Nonnull HostGroup hostGroup, Set<String> hostNames); @Override Set<String> decommissionClusterNodes(Map<String, InstanceMetaData> hostsToRemove); @Override void removeManagementServices(); @Override void deleteHostFromCluster(InstanceMetaData data); @Override void deleteUnusedCredentialsFromCluster(); @Override void restartStaleServices(); @Override Map<String, Map<String, String>> getStatusOfComponentsForHost(String host); }
ClouderaManagerClusterDecomissionService implements ClusterDecomissionService { @Override public Map<String, InstanceMetaData> collectHostsToRemove(@Nonnull HostGroup hostGroup, Set<String> hostNames) { return clouderaManagerDecomissioner.collectHostsToRemove(stack, hostGroup, hostNames, client); } ClouderaManagerClusterDecomissionService(Stack stack, HttpClientConfig clientConfig); @PostConstruct void initApiClient(); @Override void verifyNodesAreRemovable(Stack stack, Collection<InstanceMetaData> removableInstances); @Override Set<InstanceMetaData> collectDownscaleCandidates(@Nonnull HostGroup hostGroup, Integer scalingAdjustment, int defaultRootVolumeSize,
            Set<InstanceMetaData> instanceMetaDatasInStack); @Override Map<String, InstanceMetaData> collectHostsToRemove(@Nonnull HostGroup hostGroup, Set<String> hostNames); @Override Set<String> decommissionClusterNodes(Map<String, InstanceMetaData> hostsToRemove); @Override void removeManagementServices(); @Override void deleteHostFromCluster(InstanceMetaData data); @Override void deleteUnusedCredentialsFromCluster(); @Override void restartStaleServices(); @Override Map<String, Map<String, String>> getStatusOfComponentsForHost(String host);  }