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

        digidClient.remoteLog("1092", Map.of(lowerUnderscore(ACCOUNT_ID), appSession.getAccountId()));

        if (appAuthenticator.getCreatedAt().isBefore(ZonedDateTime.now().minusDays(Integer.parseInt(appAuthenticator.getGeldigheidstermijn())))) {
            digidClient.remoteLog("90", Map.of(lowerUnderscore(ACCOUNT_ID), appSession.getAccountId()));
            return new EnterActivationResponse("expired", Map.of(DAYS_VALID, Integer.valueOf(appAuthenticator.getGeldigheidstermijn())));
        }

        if (correctActivationCode(request.getActivationCode()) &&
            digidClient.activateAccount(appSession.getAccountId(), appAuthenticator.getIssuerType()).get(lowerUnderscore(STATUS)).equals("OK")) {

            ((ActivationFlow) flow).activateApp(appAuthenticator, appSession);

            attemptService.removeAttemptsForAppAuthenticator(appAuthenticator, "activation");

            return new OkResponse();
        } else if (attemptService.registerFailedAttempt(appAuthenticator, "activation")) {
            digidClient.remoteLog("87", Map.of(lowerUnderscore(ACCOUNT_ID), appSession.getAccountId()));
            if(appAuthenticator.getStatus().equals("pending"))
                appAuthenticatorService.destroyExistingAppsByInstanceId(appAuthenticator.getInstanceId());

            appSession.setState("CANCELLED");
            appSessionService.save(appSession);
            setValid(false);
            return new StatusResponse(BLOCKED);
        } else {
            digidClient.remoteLog("88", Map.of(lowerUnderscore(ACCOUNT_ID), appSession.getAccountId()));
            var letterSent = digidClient.letterSendDate((appSession.getRegistrationId()));
            return new EnterActivationResponse(INVALID, Map.of(REMAINING_ATTEMPTS, attemptService.remainingAttempts(appAuthenticator, "activation"),
                DATE_LETTER_SENT, letterSent.get("date")));
        }
    }
@Test
    void activationCodeBlockedResponse() throws SharedServiceClientException {
        //given
        mockedAppAuthenticator.setCreatedAt(ZonedDateTime.now());
        mockedAppAuthenticator.setActivationCode("3");

        when(attemptService.registerFailedAttempt(mockedAppAuthenticator, "activation")).thenReturn(true);

        mockedAppAuthenticator.setStatus("none");
        //when
        AppResponse appResponse = enterActivationCode.process(mockedFlow, activateWithCodeRequest);

        //then
        assertTrue(appResponse instanceof StatusResponse);
        assertEquals("BLOCKED", ((StatusResponse) appResponse).getStatus());
    }