@Test
    void verifyAction() {
        val r = new SamlResponseAuditPrincipalIdProvider();
        val response = mock(Response.class);
        val issuer = mock(Issuer.class);
        when(issuer.getValue()).thenReturn("https://idp.example.org");
        when(response.getIssuer()).thenReturn(issuer);
        when(response.getDestination()).thenReturn("https://sp.example.org");

        val assertion = mock(Assertion.class);
        val subject = mock(Subject.class);
        val nameId = mock(NameID.class);
        when(nameId.getValue()).thenReturn("casuser");
        when(subject.getNameID()).thenReturn(nameId);
        when(assertion.getSubject()).thenReturn(subject);
        when(response.getAssertions()).thenReturn(CollectionUtils.wrapList(assertion));
        val result = r.getPrincipalIdFrom(mock(JoinPoint.class), CoreAuthenticationTestUtils.getAuthentication(), response, null);
        assertNotNull(result);
        assertEquals("casuser", result);
        assertTrue(r.supports(mock(JoinPoint.class), CoreAuthenticationTestUtils.getAuthentication(), response, null));
    }
This is {@link SamlResponseAuditPrincipalIdProviderTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-saml-idp-web/src/test/java/org/apereo/cas/support/saml/web/idp/audit/SamlResponseAuditPrincipalIdProviderTests.java