@Test
    void verifyOperation() {
        val messageContext = new MessageContext();
        messageContext.ensureSubcontext(SAMLBindingContext.class).setRelayState(UUID.randomUUID().toString());
        messageContext.ensureSubcontext(SAMLBindingContext.class).setHasBindingSignature(true);

        messageContext.ensureSubcontext(SAMLProtocolContext.class).setProtocol(UUID.randomUUID().toString());
        messageContext.ensureSubcontext(SAMLPeerEntityContext.class).setEntityId(UUID.randomUUID().toString());

        val ctx = SamlIdPAuthenticationContext.from(messageContext);
        val encoded = ctx.encode();
        assertNotNull(encoded);

        val result = SamlIdPAuthenticationContext.decode(encoded).toMessageContext(new Object());
        assertNotNull(result);
        assertNotNull(result.getMessage());
    }
This is {@link SamlIdPAuthenticationContextTests}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/authentication/SamlIdPAuthenticationContextTests.java