@Test void testAggregateHooksNoCurrentAndNoHooksForExecution() { Module moduleToDeploy = createModule("test-module", List.of()); Mockito.when(processTypeParser.getProcessType(context.getExecution())) .thenReturn(ProcessType.DEPLOY); ModuleHooksAggregator moduleHooksAggregator = createModuleHooksAggregator(moduleToDeploy); List<Hook> aggregatedHooks = moduleHooksAggregator.aggregateHooks(Collections.emptyList()); Assertions.assertTrue(aggregatedHooks.isEmpty()); }
public List<Hook> aggregateHooks(List<HookPhase> currentHookPhasesForExecution) { Map<String, List<String>> alreadyExecutedHooksForModule = getAlreadyExecutedHooks(); List<Hook> hooksCalculatedForExecution = determineHooksForExecution(alreadyExecutedHooksForModule, currentHookPhasesForExecution); updateExecutedHooksForModule(alreadyExecutedHooksForModule, currentHookPhasesForExecution, hooksCalculatedForExecution); return hooksCalculatedForExecution; }
ModuleHooksAggregator { public List<Hook> aggregateHooks(List<HookPhase> currentHookPhasesForExecution) { Map<String, List<String>> alreadyExecutedHooksForModule = getAlreadyExecutedHooks(); List<Hook> hooksCalculatedForExecution = determineHooksForExecution(alreadyExecutedHooksForModule, currentHookPhasesForExecution); updateExecutedHooksForModule(alreadyExecutedHooksForModule, currentHookPhasesForExecution, hooksCalculatedForExecution); return hooksCalculatedForExecution; } }
ModuleHooksAggregator { public List<Hook> aggregateHooks(List<HookPhase> currentHookPhasesForExecution) { Map<String, List<String>> alreadyExecutedHooksForModule = getAlreadyExecutedHooks(); List<Hook> hooksCalculatedForExecution = determineHooksForExecution(alreadyExecutedHooksForModule, currentHookPhasesForExecution); updateExecutedHooksForModule(alreadyExecutedHooksForModule, currentHookPhasesForExecution, hooksCalculatedForExecution); return hooksCalculatedForExecution; } ModuleHooksAggregator(DelegateExecution execution, Module moduleToDeploy); }
ModuleHooksAggregator { public List<Hook> aggregateHooks(List<HookPhase> currentHookPhasesForExecution) { Map<String, List<String>> alreadyExecutedHooksForModule = getAlreadyExecutedHooks(); List<Hook> hooksCalculatedForExecution = determineHooksForExecution(alreadyExecutedHooksForModule, currentHookPhasesForExecution); updateExecutedHooksForModule(alreadyExecutedHooksForModule, currentHookPhasesForExecution, hooksCalculatedForExecution); return hooksCalculatedForExecution; } ModuleHooksAggregator(DelegateExecution execution, Module moduleToDeploy); List<Hook> aggregateHooks(List<HookPhase> currentHookPhasesForExecution); }
ModuleHooksAggregator { public List<Hook> aggregateHooks(List<HookPhase> currentHookPhasesForExecution) { Map<String, List<String>> alreadyExecutedHooksForModule = getAlreadyExecutedHooks(); List<Hook> hooksCalculatedForExecution = determineHooksForExecution(alreadyExecutedHooksForModule, currentHookPhasesForExecution); updateExecutedHooksForModule(alreadyExecutedHooksForModule, currentHookPhasesForExecution, hooksCalculatedForExecution); return hooksCalculatedForExecution; } ModuleHooksAggregator(DelegateExecution execution, Module moduleToDeploy); List<Hook> aggregateHooks(List<HookPhase> currentHookPhasesForExecution);  }