@Override
    public AppResponse process(Flow flow, SessionDataRequest request) throws SharedServiceClientException {

        return validateAmountOfApps(flow, appSession.getAccountId(), request)
            .orElseGet(() -> validateSms(flow, appSession.getAccountId(), request.getSmscode())
                .orElseGet(() -> confirmSession(flow, request)));
    }
@Test
    void processAccountRequestSessionDataTest() throws SharedServiceClientException {
        AppAuthenticator appAuthenticatorMock = new AppAuthenticator();
        appAuthenticatorMock.setAccountId(ACCOUNT_ID);
        appAuthenticatorMock.setDeviceName(mockedSessionDataRequest.getDeviceName());
        appAuthenticatorMock.setInstanceId(mockedSessionDataRequest.getInstanceId());
        appAuthenticatorMock.setIssuerType(ACTIVATION_METHOD_LETTER);
        appAuthenticatorMock.setUserAppId(APP_AUTHENTICATOR_USER_APP_ID);

        when(appAuthenticatorService.countByAccountIdAndInstanceIdNot(ACCOUNT_ID, SESSION_DATA_REQUEST_INSTANCE_ID)).thenReturn(0);
        when(appAuthenticatorService.createAuthenticator(ACCOUNT_ID, mockedSessionDataRequest.getDeviceName(), mockedSessionDataRequest.getInstanceId(), ACTIVATION_METHOD_LETTER)).thenReturn(appAuthenticatorMock);

        AppResponse appResponse = sessionConfirmed.process(mock(RequestAccountAndAppFlow.class), mockedSessionDataRequest);

        AppAuthenticator createdAppAuthenticator = sessionConfirmed.getAppAuthenticator();
        assertEquals(ACCOUNT_ID, createdAppAuthenticator.getAccountId());
        assertEquals(DEVICE_NAME, createdAppAuthenticator.getDeviceName());
        assertEquals(SESSION_DATA_REQUEST_INSTANCE_ID, createdAppAuthenticator.getInstanceId());
        assertEquals(ACTIVATION_METHOD_LETTER, createdAppAuthenticator.getIssuerType());

        assertEquals(createdAppAuthenticator.getUserAppId(), sessionConfirmed.getAppSession().getUserAppId());
        assertEquals(createdAppAuthenticator.getInstanceId(), sessionConfirmed.getAppSession().getInstanceId());

        assertEquals(VALID_RESPONSE_CODE, ((SessionDataResponse)appResponse).getStatus());
        assertEquals(APP_AUTHENTICATOR_USER_APP_ID, ((SessionDataResponse)appResponse).getUserAppId());
    }