@Test
    public void testBuildRedirectUrlWithExistingQueryParameters() throws Exception {
        val webContext = MockWebContext.create();

        val xmlObject = XMLObjectSupport.unmarshallFromReader(Configuration.getParserPool(), new StringReader(AUTHN_REQUEST));

        val encoder =
            new Pac4jHTTPRedirectDeflateEncoder(new DefaultPac4jSAMLResponse(webContext), false);
        val messageContext = new MessageContext();
        messageContext.setMessage(xmlObject);

        val encodedMessage = encoder.deflateAndBase64Encode((SAMLObject) xmlObject);
        val redirectURL = encoder.buildRedirectURL(messageContext, ENDPOINT_URL_WITH_QUERY_PARAMS, encodedMessage);

        assertTrue(redirectURL.contains("qp=0000"));
        assertTrue(redirectURL.contains("SAMLRequest"));
        assertFalse(redirectURL.contains("SAMLRequest=fakeRequest"));
        assertFalse(redirectURL.contains("RelayState"));
        assertFalse(redirectURL.contains("SigAlg"));
        assertFalse(redirectURL.contains("Signature"));
    }
Tests {@link Pac4jHTTPRedirectDeflateDecoder}.

@author Jerome Leleu
@since 3.4.0
pac4j-saml/src/test/java/org/pac4j/saml/transport/Pac4jHTTPRedirectDeflateDecoderTest.java