@Test void executeBeforeStepHooksWhenModuleToDeployIsNull() { Mockito.when(processTypeParser.getProcessType(any())) .thenReturn(ProcessType.DEPLOY); HooksExecutor hooksExecutor = new HooksExecutor(hooksCalculator, null); Mockito.when(hooksCalculator.isInPreExecuteStepPhase(StepPhase.EXECUTE)) .thenReturn(true); List<Hook> hooksForExecution = hooksExecutor.executeBeforeStepHooks(StepPhase.EXECUTE); Assertions.assertTrue(hooksForExecution.isEmpty()); }
public List<Hook> executeBeforeStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPreExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); }
HooksExecutor { public List<Hook> executeBeforeStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPreExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); } }
HooksExecutor { public List<Hook> executeBeforeStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPreExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); } HooksExecutor(HooksCalculator hooksCalculator, Module moduleToDeploy); }
HooksExecutor { public List<Hook> executeBeforeStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPreExecuteStepPhase(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> executeBeforeStepHooks(StepPhase currentStepPhase) { if (!hooksCalculator.isInPreExecuteStepPhase(currentStepPhase)) { return Collections.emptyList(); } return executeHooks(currentStepPhase); } HooksExecutor(HooksCalculator hooksCalculator, Module moduleToDeploy); List<Hook> executeBeforeStepHooks(StepPhase currentStepPhase); List<Hook> executeAfterStepHooks(StepPhase currentStepPhase);  }