@Test public void shouldIgnoreIfNoInstancesToRepair() { underTest.add(stack, Collections.emptySet()); verifyZeroInteractions(executorService); verify(flowMessageService).fireEventAndLog(stack.getId(), Status.AVAILABLE.name(), STACK_REPAIR_COMPLETE_CLEAN); }
public void add(Stack stack, Collection<String> unhealthyInstanceIds) { if (unhealthyInstanceIds.isEmpty()) { LOGGER.debug("No instances are unhealthy, returning..."); flowMessageService.fireEventAndLog(stack.getId(), Status.AVAILABLE.name(), STACK_REPAIR_COMPLETE_CLEAN); return; } UnhealthyInstances unhealthyInstances = groupInstancesByHostGroups(stack, unhealthyInstanceIds); Runnable stackRepairFlowSubmitter = new StackRepairFlowSubmitter(stack.getId(), unhealthyInstances); flowMessageService.fireEventAndLog(stack.getId(), Status.UPDATE_IN_PROGRESS.name(), STACK_REPAIR_ATTEMPTING); executorService.submit(stackRepairFlowSubmitter); }
StackRepairService { public void add(Stack stack, Collection<String> unhealthyInstanceIds) { if (unhealthyInstanceIds.isEmpty()) { LOGGER.debug("No instances are unhealthy, returning..."); flowMessageService.fireEventAndLog(stack.getId(), Status.AVAILABLE.name(), STACK_REPAIR_COMPLETE_CLEAN); return; } UnhealthyInstances unhealthyInstances = groupInstancesByHostGroups(stack, unhealthyInstanceIds); Runnable stackRepairFlowSubmitter = new StackRepairFlowSubmitter(stack.getId(), unhealthyInstances); flowMessageService.fireEventAndLog(stack.getId(), Status.UPDATE_IN_PROGRESS.name(), STACK_REPAIR_ATTEMPTING); executorService.submit(stackRepairFlowSubmitter); } }
StackRepairService { public void add(Stack stack, Collection<String> unhealthyInstanceIds) { if (unhealthyInstanceIds.isEmpty()) { LOGGER.debug("No instances are unhealthy, returning..."); flowMessageService.fireEventAndLog(stack.getId(), Status.AVAILABLE.name(), STACK_REPAIR_COMPLETE_CLEAN); return; } UnhealthyInstances unhealthyInstances = groupInstancesByHostGroups(stack, unhealthyInstanceIds); Runnable stackRepairFlowSubmitter = new StackRepairFlowSubmitter(stack.getId(), unhealthyInstances); flowMessageService.fireEventAndLog(stack.getId(), Status.UPDATE_IN_PROGRESS.name(), STACK_REPAIR_ATTEMPTING); executorService.submit(stackRepairFlowSubmitter); }  }
StackRepairService { public void add(Stack stack, Collection<String> unhealthyInstanceIds) { if (unhealthyInstanceIds.isEmpty()) { LOGGER.debug("No instances are unhealthy, returning..."); flowMessageService.fireEventAndLog(stack.getId(), Status.AVAILABLE.name(), STACK_REPAIR_COMPLETE_CLEAN); return; } UnhealthyInstances unhealthyInstances = groupInstancesByHostGroups(stack, unhealthyInstanceIds); Runnable stackRepairFlowSubmitter = new StackRepairFlowSubmitter(stack.getId(), unhealthyInstances); flowMessageService.fireEventAndLog(stack.getId(), Status.UPDATE_IN_PROGRESS.name(), STACK_REPAIR_ATTEMPTING); executorService.submit(stackRepairFlowSubmitter); }  void add(Stack stack, Collection<String> unhealthyInstanceIds); }
StackRepairService { public void add(Stack stack, Collection<String> unhealthyInstanceIds) { if (unhealthyInstanceIds.isEmpty()) { LOGGER.debug("No instances are unhealthy, returning..."); flowMessageService.fireEventAndLog(stack.getId(), Status.AVAILABLE.name(), STACK_REPAIR_COMPLETE_CLEAN); return; } UnhealthyInstances unhealthyInstances = groupInstancesByHostGroups(stack, unhealthyInstanceIds); Runnable stackRepairFlowSubmitter = new StackRepairFlowSubmitter(stack.getId(), unhealthyInstances); flowMessageService.fireEventAndLog(stack.getId(), Status.UPDATE_IN_PROGRESS.name(), STACK_REPAIR_ATTEMPTING); executorService.submit(stackRepairFlowSubmitter); }  void add(Stack stack, Collection<String> unhealthyInstanceIds);  }