@Test public void whenStackNotDeletedAndForcedTerminationFlowLogAndNotForcedShouldNotTerminate() { when(flowLogService.findAllByResourceIdAndFinalizedIsFalseOrderByCreatedDesc(anyLong())).thenReturn(List.of(getTerminationFlowLog(true))); underTest.triggerTermination(getAvailableStack(), false); verifyNoTerminationEventFired(); }
public void triggerTermination(Stack stack, boolean forced) { flowCancelService.cancelTooOldTerminationFlowForResource(stack.getId(), stack.getName()); if (!stack.isDeleteCompleted()) { handleIfStackIsNotTerminated(stack, forced); } else { LOGGER.debug("Stack is already deleted."); } }
TerminationTriggerService { public void triggerTermination(Stack stack, boolean forced) { flowCancelService.cancelTooOldTerminationFlowForResource(stack.getId(), stack.getName()); if (!stack.isDeleteCompleted()) { handleIfStackIsNotTerminated(stack, forced); } else { LOGGER.debug("Stack is already deleted."); } } }
TerminationTriggerService { public void triggerTermination(Stack stack, boolean forced) { flowCancelService.cancelTooOldTerminationFlowForResource(stack.getId(), stack.getName()); if (!stack.isDeleteCompleted()) { handleIfStackIsNotTerminated(stack, forced); } else { LOGGER.debug("Stack is already deleted."); } }  }
TerminationTriggerService { public void triggerTermination(Stack stack, boolean forced) { flowCancelService.cancelTooOldTerminationFlowForResource(stack.getId(), stack.getName()); if (!stack.isDeleteCompleted()) { handleIfStackIsNotTerminated(stack, forced); } else { LOGGER.debug("Stack is already deleted."); } }  void triggerTermination(Stack stack, boolean forced); }
TerminationTriggerService { public void triggerTermination(Stack stack, boolean forced) { flowCancelService.cancelTooOldTerminationFlowForResource(stack.getId(), stack.getName()); if (!stack.isDeleteCompleted()) { handleIfStackIsNotTerminated(stack, forced); } else { LOGGER.debug("Stack is already deleted."); } }  void triggerTermination(Stack stack, boolean forced);  }