public String redirectWithCorrectAttributesForAd(HttpServletRequest httpRequest, AuthenticationRequest authenticationRequest) throws UnsupportedEncodingException, SamlSessionException {
        SamlSession samlSession = authenticationRequest.getSamlSession();

        if (samlSession.getValidationStatus() != null && samlSession.getValidationStatus().equals(STATUS_INVALID.label)) {
            return cancelAuthenticationToAd(authenticationRequest, samlSession.getArtifact());
        } else if (samlSession.getRequesterId() != null && samlSession.getRequesterId().equals(bvdEntityId)) {
            prepareAuthenticationToAdForBvd(samlSession);
            String bvdReturnUrl = generateReturnUrl(httpRequest, samlSession.getArtifact(), ENTRANCE_RETURN_URL_BVD);
            logger.info("Prepare authentication to Ad for Bvd");
            return prepareAuthenticationToAd(bvdReturnUrl, authenticationRequest);
        } else {
            String adReturnUrl = generateReturnUrl(httpRequest, samlSession.getArtifact(), REDIRECT_WITH_ARTIFACT_URL);
            return prepareAuthenticationToAd(adReturnUrl, authenticationRequest);
        }
    }
@Test
    public void redirectWithCorrectAttributesForAdTest() throws UnsupportedEncodingException, SamlSessionException {
        AuthenticationRequest authenticationRequest = new AuthenticationRequest();
        authenticationRequest.setRequest(httpServletRequestMock);
        SamlSession samlSession = new SamlSession(1L);
        samlSession.setRequesterId("DvEntity");
        samlSession.setArtifact("artifact");
        authenticationRequest.setSamlSession(samlSession);

        String result = authenticationEntranceService.redirectWithCorrectAttributesForAd(httpServletRequestMock, authenticationRequest);

        assertNotNull(result);
        assertNull(samlSession.getTransactionId());
        assertEquals(result, frontChannel);
    }