@Test void testBuildHookPhaseForBlueGreenProcessWithPhaseAfterResume() { Mockito.when(processTypeParser.getProcessType(context.getExecution())) .thenReturn(ProcessType.BLUE_GREEN_DEPLOY); context.setVariable(Variables.PHASE, Phase.AFTER_RESUME); HooksPhaseBuilder hooksPhaseBuilder = new HooksPhaseBuilder(processTypeParser); List<HookPhase> hookPhases = hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.BEFORE_START), context); Assertions.assertEquals(List.of(HookPhase.BLUE_GREEN_APPLICATION_BEFORE_START_LIVE), hookPhases); }
public List<HookPhase> buildHookPhases(List<HookPhase> hookPhases, ProcessContext context) { return hookPhases.stream() .map(hookPhase -> buildPhase(hookPhase, context)) .map(HookPhase::fromString) .collect(Collectors.toList()); }
HooksPhaseBuilder { public List<HookPhase> buildHookPhases(List<HookPhase> hookPhases, ProcessContext context) { return hookPhases.stream() .map(hookPhase -> buildPhase(hookPhase, context)) .map(HookPhase::fromString) .collect(Collectors.toList()); } }
HooksPhaseBuilder { public List<HookPhase> buildHookPhases(List<HookPhase> hookPhases, ProcessContext context) { return hookPhases.stream() .map(hookPhase -> buildPhase(hookPhase, context)) .map(HookPhase::fromString) .collect(Collectors.toList()); } @Inject  HooksPhaseBuilder(ProcessTypeParser processTypeParser); }
HooksPhaseBuilder { public List<HookPhase> buildHookPhases(List<HookPhase> hookPhases, ProcessContext context) { return hookPhases.stream() .map(hookPhase -> buildPhase(hookPhase, context)) .map(HookPhase::fromString) .collect(Collectors.toList()); } @Inject  HooksPhaseBuilder(ProcessTypeParser processTypeParser); List<HookPhase> buildHookPhases(List<HookPhase> hookPhases, ProcessContext context); }
HooksPhaseBuilder { public List<HookPhase> buildHookPhases(List<HookPhase> hookPhases, ProcessContext context) { return hookPhases.stream() .map(hookPhase -> buildPhase(hookPhase, context)) .map(HookPhase::fromString) .collect(Collectors.toList()); } @Inject  HooksPhaseBuilder(ProcessTypeParser processTypeParser); List<HookPhase> buildHookPhases(List<HookPhase> hookPhases, ProcessContext context);  }