@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 processRequestAccountAndAppFlow() throws SharedServiceClientException {
        AppAuthenticator authenticator = new AppAuthenticator();
        authenticator.setUserAppId(UUID.randomUUID().toString());
        authenticator.setAccountId(ACCOUNT_ID);
        authenticator.setDeviceName(DEVICE_NAME);
        authenticator.setInstanceId(SESSION_DATA_REQUEST_INSTANCE_ID);
        authenticator.setIssuerType("letter");
        authenticator.setSubstantieelActivatedAt(null);

        when(appAuthenticatorService.createAuthenticator(ACCOUNT_ID, DEVICE_NAME, SESSION_DATA_REQUEST_INSTANCE_ID, "letter")).thenReturn(authenticator);

        AppResponse appResponse = sessionConfirmed.process(mockedRequestAccountAndAppFlow, mockedSessionDataRequest);

        AppAuthenticator appAuthenticator = sessionConfirmed.getAppAuthenticator();
        assertNotSame(mockedAppAuthenticator, appAuthenticator);
        assertEquals(DEVICE_NAME, appAuthenticator.getDeviceName());
        assertEquals(SESSION_DATA_REQUEST_INSTANCE_ID, appAuthenticator.getInstanceId());
        assertEquals("letter", appAuthenticator.getIssuerType());
        assertEquals(VALID_RESPONSE_CODE, ((SessionDataResponse)appResponse).getStatus());
    }