private static SAML2MessageContext getSaml2MessageContext(final MockWebContext webContext, final String xml) {
        val context = new SAML2MessageContext(new CallContext(webContext, new MockSessionStore()));
        context.setSaml2Configuration(getSaml2Configuration());

        val samlMessage = new MessageContext();
        val samlResponse = (LogoutResponse) Configuration.deserializeSamlObject(xml).get();

        samlMessage.setMessage(samlResponse);
        context.setMessageContext(samlMessage);
        val entityDescriptor = new EntityDescriptorBuilder().buildObject();
        context.getSAMLPeerMetadataContext().setEntityDescriptor(entityDescriptor);

        val spDescriptor = new SPSSODescriptorBuilder().buildObject();
        val logoutService = new SingleLogoutServiceBuilder().buildObject();
        logoutService.setLocation("http://sp.example.com/demo1/logout");
        spDescriptor.getSingleLogoutServices().add(logoutService);
        context.getSAMLSelfMetadataContext().setRoleDescriptor(spDescriptor);
        return context;
    }
This is {@link SAML2LogoutValidatorTests}.

@author Misagh Moayyed
@since 5.0.0
pac4j-saml/src/test/java/org/pac4j/saml/logout/impl/SAML2LogoutValidatorTests.java