@Test public void whenStackNotDeletedAndNotTerminationFlowLogAndKerbAndNotForcedShouldTerminate() { FlowLog flowLog = new FlowLog(); flowLog.setFlowType(StackCreationFlowConfig.class); when(flowLogService.findAllByResourceIdAndFinalizedIsFalseOrderByCreatedDesc(anyLong())).thenReturn(List.of(flowLog)); setupKerberized(); underTest.triggerTermination(getAvailableStack(), false); verifyTerminationEventFired(true, false); }
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);  }