@Override
    public AppResponse processAction(String flowType, BaseAction action, AppRequest request, AppSession appSession) throws FlowStateNotDefinedException, FlowNotDefinedException, SharedServiceClientException, NoSuchAlgorithmException, IOException {
        Flow flow = flowFactoryFactory.getFactory(flowType).getFlow(ConfirmSessionFlow.NAME);
        AbstractFlowStep flowStep = flow.validateStateTransition(stateValueOf(appSession.getState().toUpperCase()), action);
        if (flowStep == null) {
            logger.error("nl.logius.digid.app.domain.shared.flow transition not allowed:{} - {} -> {}", flow.getClass(), appSession.getState(), action);
            return new NokResponse("nl.logius.digid.app.domain.shared.flow transition not allowed");
        }
        flowStep.setAppSession(appSession);

        if (flowStep.expectAppAuthenticator()) {
            flowStep.setAppAuthenticator(getAppAuthenticator(appSession));
        }

        AppResponse appResponse = flow.processState(flowStep, request);
        if (appResponse instanceof NokResponse || !flowStep.isValid()) {
            return appResponse;
        }

        appSession.setState(getStateName(flow.getNextState(stateValueOf(appSession.getState().toUpperCase()), action)));

        if (flowStep.getAppAuthenticator() != null) {
            appAuthenticatorService.save(flowStep.getAppAuthenticator());

            if (appSession.getDeviceName() == null) {
                appSession.setDeviceName(flowStep.getAppAuthenticator().getDeviceName());
                appSession.setAppCode(flowStep.getAppAuthenticator().getAppCode());
            }
        }

        appSessionService.save(appSession);

        return appResponse;
    }
@Test
    public void processActionOkResponseTest() throws FlowNotDefinedException, SharedServiceClientException, IOException, NoSuchAlgorithmException, FlowStateNotDefinedException {
        //given
        when(abstractFlowStep.isValid()).thenReturn(true);
        //when
        AppResponse response = confirmationFlowService.processAction("confirm", Action.CONFIRM, confirmRequest, appSession);
    }