public Map<String, Object> createAuthenticationParameters(String relayState, AuthenticationRequest authenticationRequest) throws AdException {

        HashMap<String, String> digidApp = new HashMap<>();
        digidApp.put("name", authenticationRequest.getServiceName());
        digidApp.put("url", authenticationRequest.getAppReturnUrl());

        Map<String, Object> authenticationParameters = new HashMap<>();
        authenticationParameters.put("app_session_id", retrieveAppSessionIdFromAd(authenticationRequest.getAppReturnUrl(), authenticationRequest));
        authenticationParameters.put("SAMLart", authenticationRequest.getSamlSession().getArtifact());
        authenticationParameters.put("apps", authenticationRequest.getAppActive() ? Arrays.asList(digidApp) : Collections.emptyList());
        authenticationParameters.put("authentication_level", authenticationRequest.getSamlSession().getAuthenticationLevel());
        authenticationParameters.put("image_domain", authenticationRequest.getAppReturnUrl());
        authenticationParameters.put("RelayState", relayState);

        return authenticationParameters;
    }
@Test
    public void createAuthenticationParametersSuccessful() throws AdException {
        AdSession adSession = new AdSession();
        adSession.setSessionId("sessionId");
        when(adClientMock.startAppSession(anyString())).thenReturn(adResponse);

        Map<String, Object> result = authenticationAppToAppService.createAuthenticationParameters("relayState", authenticationRequest);

        assertNotNull(result);
        assertEquals(6, result.size());
        assertEquals("appSessionId", result.get("app_session_id"));
        assertEquals("artifact", result.get("SAMLart"));
        assertEquals(20, result.get("authentication_level"));
        assertEquals("appReturnUrl", result.get("image_domain"));
        assertEquals("relayState", result.get("RelayState"));
    }