@Override
    public AppResponse process(Flow flow, ActivateWithCodeRequest request) throws FlowNotDefinedException, IOException, NoSuchAlgorithmException {

        Map<String, Object> result = digidClient.activateAccountWithCode(appSession.getAccountId(), request.getActivationCode());

        if (result.get(lowerUnderscore(STATUS)).equals("OK")) {
            appAuthenticator.setIssuerType((String) result.get(lowerUnderscore(ISSUER_TYPE)));
            return new OkResponse();
        }

        if (result.get(lowerUnderscore(STATUS)).equals("NOK") && result.get(ERROR) != null ) {
            final var error = result.get(ERROR);

            if (ERROR_CODE_NOT_CORRECT.equals(error)) {
                // Logcode 88 is already logged in x, can be changed when switching to account microservice :
                return new EnterActivationResponse(ERROR_CODE_NOT_CORRECT, Map.of(REMAINING_ATTEMPTS, result.get(lowerUnderscore(REMAINING_ATTEMPTS))));

            } else if (ERROR_CODE_BLOCKED.equals(error)) {
                digidClient.remoteLog("87", Map.of(lowerUnderscore(ACCOUNT_ID), appSession.getAccountId()));
                return new NokResponse((String) result.get(ERROR));

            } else if (ERROR_CODE_INVALID.equals(error)) {
                digidClient.remoteLog("90", Map.of(lowerUnderscore(ACCOUNT_ID), appSession.getAccountId()));
                return new EnterActivationResponse(ERROR_CODE_INVALID, Map.of(DAYS_VALID, result.get(lowerUnderscore(DAYS_VALID))));
            }
        }

        return new NokResponse();
    }
@Test
    public void responseBlockedTest() throws FlowNotDefinedException, IOException, NoSuchAlgorithmException {
        //given
        when(digidClientMock.activateAccountWithCode(anyLong(), any())).thenReturn(Map.of(
            lowerUnderscore(STATUS), "NOK",
            lowerUnderscore(ERROR), "activation_code_blocked",
            lowerUnderscore(ERROR_CODE_BLOCKED), "activation_code_blocked"
        ));
        //when
        AppResponse result = activationCodeChecked.process(mockedFlow, activateWithCodeRequest);
        //then
        verify(digidClientMock, times(1)).remoteLog("87", ImmutableMap.of(lowerUnderscore(ACCOUNT_ID), mockedAppSession.getAccountId()));
        assertTrue(result instanceof NokResponse);
        assertEquals("activation_code_blocked", ((NokResponse) result).getError());
    }