@Test void executeAfterStepHooksWhenPhaseIsNotAfter() { Module moduleToDeploy = createModule("test-module"); Mockito.when(processTypeParser.getProcessType(any())) .thenReturn(ProcessType.DEPLOY); HooksExecutor hooksExecutor = new HooksExecutor(hooksCalculator, moduleToDeploy); List<Hook> hooksForExecution = hooksExecutor.executeAfterStepHooks(StepPhase.EXECUTE); Assertions.assertTrue(hooksForExecution.isEmpty()); }
public List<Hook> executeAfterStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPostExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); }
HooksExecutor { public List<Hook> executeAfterStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPostExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); } }
HooksExecutor { public List<Hook> executeAfterStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPostExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); } HooksExecutor(HooksCalculator hooksCalculator, Module moduleToDeploy); }
HooksExecutor { public List<Hook> executeAfterStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPostExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); } HooksExecutor(HooksCalculator hooksCalculator, Module moduleToDeploy); List<Hook> executeBeforeStepHooks(StepPhase currentStepPhase); List<Hook> executeAfterStepHooks(StepPhase currentStepPhase); }
HooksExecutor { public List<Hook> executeAfterStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPostExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); } HooksExecutor(HooksCalculator hooksCalculator, Module moduleToDeploy); List<Hook> executeBeforeStepHooks(StepPhase currentStepPhase); List<Hook> executeAfterStepHooks(StepPhase currentStepPhase);  }