@Override
    public AppResponse process(Flow flow, AppSessionRequest request) {
        if (appSession.getRegistrationId() == null) {
            return new NokResponse();
        }

        Map<String, String> result = digidClient.getExistingApplication(appSession.getRegistrationId());

        if (result.get(lowerUnderscore(STATUS)).equals("OK")) {
            return new OkResponse();
        } else if (result.get(lowerUnderscore(STATUS)).equals("PENDING")) {
            // switch state to require replace action
            appSession.setState(State.EXISTING_APPLICATION_FOUND.name());
            return new StatusResponse("PENDING");
        } else {
            return new NokResponse();
        }
    }
@Test
    void processOKTest(){
        when(digidClientMock.getExistingApplication(1337L)).thenReturn(Map.of(
            lowerUnderscore(STATUS), "OK"
        ));

        AppResponse appResponse = checkExistingApplication.process(flowMock, null);

        assertTrue(appResponse instanceof OkResponse);
        assertEquals("OK", ((OkResponse) appResponse).getStatus());
    }