@Test void testExecuteHooksForPhaseNoHooks() { HooksCalculator hooksHelper = createHooksCalculator(HookPhase.NONE, HookPhase.NONE); Module moduleToDeploy = createModule("module-to-deploy"); Mockito.when(processTypeParser.getProcessType(context.getExecution())) .thenReturn(ProcessType.DEPLOY); List<Hook> hooksForCurrentPhase = hooksHelper.calculateHooksForExecution(moduleToDeploy, StepPhase.POLL); Assertions.assertEquals(0, hooksForCurrentPhase.size()); }
public List<Hook> calculateHooksForExecution(Module moduleToDeploy, StepPhase currentStepPhase) { List<HookPhase> currentHookPhasesForExecution = determineHookPhaseForCurrentStepPhase(currentStepPhase); return getHooksForCurrentPhase(moduleToDeploy, currentHookPhasesForExecution); }
HooksCalculator { public List<Hook> calculateHooksForExecution(Module moduleToDeploy, StepPhase currentStepPhase) { List<HookPhase> currentHookPhasesForExecution = determineHookPhaseForCurrentStepPhase(currentStepPhase); return getHooksForCurrentPhase(moduleToDeploy, currentHookPhasesForExecution); } }
HooksCalculator { public List<Hook> calculateHooksForExecution(Module moduleToDeploy, StepPhase currentStepPhase) { List<HookPhase> currentHookPhasesForExecution = determineHookPhaseForCurrentStepPhase(currentStepPhase); return getHooksForCurrentPhase(moduleToDeploy, currentHookPhasesForExecution); }  }
HooksCalculator { public List<Hook> calculateHooksForExecution(Module moduleToDeploy, StepPhase currentStepPhase) { List<HookPhase> currentHookPhasesForExecution = determineHookPhaseForCurrentStepPhase(currentStepPhase); return getHooksForCurrentPhase(moduleToDeploy, currentHookPhasesForExecution); }  List<Hook> calculateHooksForExecution(Module moduleToDeploy, StepPhase currentStepPhase); void setHooksForExecution(List<Hook> hooksForExecution); abstract ProcessContext getContext(); abstract List<HookPhase> getHookPhasesBeforeStep(); abstract List<HookPhase> getHookPhasesAfterStep(); }
HooksCalculator { public List<Hook> calculateHooksForExecution(Module moduleToDeploy, StepPhase currentStepPhase) { List<HookPhase> currentHookPhasesForExecution = determineHookPhaseForCurrentStepPhase(currentStepPhase); return getHooksForCurrentPhase(moduleToDeploy, currentHookPhasesForExecution); }  List<Hook> calculateHooksForExecution(Module moduleToDeploy, StepPhase currentStepPhase); void setHooksForExecution(List<Hook> hooksForExecution); abstract ProcessContext getContext(); abstract List<HookPhase> getHookPhasesBeforeStep(); abstract List<HookPhase> getHookPhasesAfterStep();  }