@Test void testStopPollerWhenPollerCrnIsEmpty() throws Exception { AttemptResult<Void> result = underTest.stopDatahubClustersPoller(new ArrayList<>(), ENV_ID).process(); assertEquals(AttemptState.FINISH, result.getState()); }
public AttemptMaker<Void> stopDatahubClustersPoller(List<String> datahubCrns, Long envId) { List<String> mutableCrnList = new ArrayList<>(datahubCrns); return () -> { List<String> remaining = new ArrayList<>(); List<AttemptResult<Void>> results = collectDatahubStopResults(mutableCrnList, remaining, envId); mutableCrnList.retainAll(remaining); return clusterPollerResultEvaluator.evaluateResult(results); }; }
DatahubPollerProvider { public AttemptMaker<Void> stopDatahubClustersPoller(List<String> datahubCrns, Long envId) { List<String> mutableCrnList = new ArrayList<>(datahubCrns); return () -> { List<String> remaining = new ArrayList<>(); List<AttemptResult<Void>> results = collectDatahubStopResults(mutableCrnList, remaining, envId); mutableCrnList.retainAll(remaining); return clusterPollerResultEvaluator.evaluateResult(results); }; } }
DatahubPollerProvider { public AttemptMaker<Void> stopDatahubClustersPoller(List<String> datahubCrns, Long envId) { List<String> mutableCrnList = new ArrayList<>(datahubCrns); return () -> { List<String> remaining = new ArrayList<>(); List<AttemptResult<Void>> results = collectDatahubStopResults(mutableCrnList, remaining, envId); mutableCrnList.retainAll(remaining); return clusterPollerResultEvaluator.evaluateResult(results); }; } DatahubPollerProvider(DatahubService datahubService, ClusterPollerResultEvaluator clusterPollerResultEvaluator); }
DatahubPollerProvider { public AttemptMaker<Void> stopDatahubClustersPoller(List<String> datahubCrns, Long envId) { List<String> mutableCrnList = new ArrayList<>(datahubCrns); return () -> { List<String> remaining = new ArrayList<>(); List<AttemptResult<Void>> results = collectDatahubStopResults(mutableCrnList, remaining, envId); mutableCrnList.retainAll(remaining); return clusterPollerResultEvaluator.evaluateResult(results); }; } DatahubPollerProvider(DatahubService datahubService, ClusterPollerResultEvaluator clusterPollerResultEvaluator); AttemptMaker<Void> startDatahubClustersPoller(List<String> datahubCrns, Long envId); AttemptMaker<Void> stopDatahubClustersPoller(List<String> datahubCrns, Long envId); }
DatahubPollerProvider { public AttemptMaker<Void> stopDatahubClustersPoller(List<String> datahubCrns, Long envId) { List<String> mutableCrnList = new ArrayList<>(datahubCrns); return () -> { List<String> remaining = new ArrayList<>(); List<AttemptResult<Void>> results = collectDatahubStopResults(mutableCrnList, remaining, envId); mutableCrnList.retainAll(remaining); return clusterPollerResultEvaluator.evaluateResult(results); }; } DatahubPollerProvider(DatahubService datahubService, ClusterPollerResultEvaluator clusterPollerResultEvaluator); AttemptMaker<Void> startDatahubClustersPoller(List<String> datahubCrns, Long envId); AttemptMaker<Void> stopDatahubClustersPoller(List<String> datahubCrns, Long envId);  }