@Test
    void verifyLogoutResponse() throws Exception {
        val context = MockRequestContext.create(applicationContext);
        context.setMethod(HttpMethod.POST);
        val webContext = new JEEContext(context.getHttpServletRequest(), context.getHttpServletResponse());
        val manager = new ProfileManager(webContext, delegatedClientDistributedSessionStore);
        val profile = new CommonProfile();
        profile.setId(UUID.randomUUID().toString());
        profile.setClientName("SAML2Client");
        manager.save(true, profile, false);

        var delegatedClientLogoutRequest = DelegatedAuthenticationClientLogoutRequest
            .builder()
            .target("https://google.com")
            .status(200)
            .build();

        val logoutRequestId = UUID.randomUUID().toString();
        val logoutRequestTicketId = TransientSessionTicketFactory.normalizeTicketId(logoutRequestId);
        val transientFactory = (TransientSessionTicketFactory) ticketFactory.get(TransientSessionTicket.class);
        val transientSessionTicket = transientFactory.create(logoutRequestTicketId,
            Map.of(DelegatedAuthenticationClientLogoutRequest.class.getName(), delegatedClientLogoutRequest));
        ticketRegistry.addTicket(transientSessionTicket);
        val saml2MessageContext = new SAML2MessageContext(new CallContext(webContext, delegatedClientDistributedSessionStore));
        val messageContext = new MessageContext();
        val logoutResponse = mock(LogoutResponse.class);
        when(logoutResponse.getInResponseTo()).thenReturn(logoutRequestId);
        messageContext.setMessage(logoutResponse);
        saml2MessageContext.setMessageContext(messageContext);
        val clientCred = new ClientCredential(new SAML2Credentials(saml2MessageContext),
            profile.getClientName(), false, profile);
        WebUtils.putCredential(context, clientCred);
        delegatedSaml2ClientLogoutAction.execute(context);
        delegatedClientLogoutRequest = DelegationWebflowUtils.getDelegatedAuthenticationLogoutRequest(context,
            DelegatedAuthenticationClientLogoutRequest.class);
        assertNotNull(delegatedClientLogoutRequest);
        assertNull(DelegationWebflowUtils.getDelegatedAuthenticationLogoutRequestTicket(context));
        assertNull(ticketRegistry.getTicket(logoutRequestTicketId));
    }
This is {@link DelegatedSaml2ClientLogoutActionTests}.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-pac4j-saml/src/test/java/org/apereo/cas/web/saml2/DelegatedSaml2ClientLogoutActionTests.java