@Test void createFlowContext() { Stack stack = new Stack(); when(stackService.getByIdWithClusterInTransaction(1L)).thenReturn(stack); semaphore = false; ExternalDatabaseContext flowContext = underTest.createFlowContext(flowParameters, stateContext, new TestPayload()); assertThat(flowContext.getFlowParameters()).isEqualTo(flowParameters); assertThat(flowContext.getStack()).isEqualTo(stack); assertThat(semaphore).isTrue(); }
@Override protected ExternalDatabaseContext createFlowContext(FlowParameters flowParameters, StateContext<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent> stateContext, P payload) { Stack stack = stackService.getByIdWithClusterInTransaction(payload.getResourceId()); MDCBuilder.buildMdcContext(stack); beforeReturnFlowContext(flowParameters, stateContext, payload); return new ExternalDatabaseContext(flowParameters, stack); }
AbstractExternalDatabaseCreationAction extends AbstractStackAction<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent, ExternalDatabaseContext, P> { @Override protected ExternalDatabaseContext createFlowContext(FlowParameters flowParameters, StateContext<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent> stateContext, P payload) { Stack stack = stackService.getByIdWithClusterInTransaction(payload.getResourceId()); MDCBuilder.buildMdcContext(stack); beforeReturnFlowContext(flowParameters, stateContext, payload); return new ExternalDatabaseContext(flowParameters, stack); } }
AbstractExternalDatabaseCreationAction extends AbstractStackAction<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent, ExternalDatabaseContext, P> { @Override protected ExternalDatabaseContext createFlowContext(FlowParameters flowParameters, StateContext<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent> stateContext, P payload) { Stack stack = stackService.getByIdWithClusterInTransaction(payload.getResourceId()); MDCBuilder.buildMdcContext(stack); beforeReturnFlowContext(flowParameters, stateContext, payload); return new ExternalDatabaseContext(flowParameters, stack); } protected  AbstractExternalDatabaseCreationAction(Class<P> payloadClass); }
AbstractExternalDatabaseCreationAction extends AbstractStackAction<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent, ExternalDatabaseContext, P> { @Override protected ExternalDatabaseContext createFlowContext(FlowParameters flowParameters, StateContext<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent> stateContext, P payload) { Stack stack = stackService.getByIdWithClusterInTransaction(payload.getResourceId()); MDCBuilder.buildMdcContext(stack); beforeReturnFlowContext(flowParameters, stateContext, payload); return new ExternalDatabaseContext(flowParameters, stack); } protected  AbstractExternalDatabaseCreationAction(Class<P> payloadClass);  }
AbstractExternalDatabaseCreationAction extends AbstractStackAction<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent, ExternalDatabaseContext, P> { @Override protected ExternalDatabaseContext createFlowContext(FlowParameters flowParameters, StateContext<ExternalDatabaseCreationState, ExternalDatabaseCreationEvent> stateContext, P payload) { Stack stack = stackService.getByIdWithClusterInTransaction(payload.getResourceId()); MDCBuilder.buildMdcContext(stack); beforeReturnFlowContext(flowParameters, stateContext, payload); return new ExternalDatabaseContext(flowParameters, stack); } protected  AbstractExternalDatabaseCreationAction(Class<P> payloadClass);   }