### Question:
StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, context); hookPhases.add(HookPhase.AFTER_STOP); return hooksPhaseBuilder.buildHookPhases(hookPhases, context); }  @Override StepPhase executeStepInternal(ProcessContext context); @Override List<HookPhase> getHookPhasesBeforeStep(ProcessContext context); @Override List<HookPhase> getHookPhasesAfterStep(ProcessContext context);  }### Answer:
@Test void testGetHooksAfterStep() { Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.APPLICATION_AFTER_STOP_LIVE, HookPhase.AFTER_STOP), context)) .thenReturn(List.of(HookPhase.BLUE_GREEN_APPLICATION_AFTER_STOP_LIVE, HookPhase.APPLICATION_AFTER_STOP_LIVE)); List<HookPhase> expectedPhases = List.of(HookPhase.BLUE_GREEN_APPLICATION_AFTER_STOP_LIVE, HookPhase.APPLICATION_AFTER_STOP_LIVE); List<HookPhase> hookPhasesBeforeStep = step.getHookPhasesAfterStep(context); assertEquals(expectedPhases, hookPhasesBeforeStep); }
@Test void testGetHooksAfterStepWithBlueGreenProcess() { Mockito.when(processTypeParser.getProcessType(context.getExecution())) .thenReturn(ProcessType.BLUE_GREEN_DEPLOY); Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.AFTER_STOP), context)) .thenReturn(List.of(HookPhase.BLUE_GREEN_APPLICATION_AFTER_STOP_LIVE, HookPhase.APPLICATION_AFTER_STOP_IDLE)); List<HookPhase> expectedPhases = List.of(HookPhase.BLUE_GREEN_APPLICATION_AFTER_STOP_LIVE, HookPhase.APPLICATION_AFTER_STOP_IDLE); List<HookPhase> hookPhasesBeforeStep = step.getHookPhasesAfterStep(context); assertEquals(expectedPhases, hookPhasesBeforeStep); }