@Test
    void verifyAttributeAsNameIDSameAsSubject() throws Throwable {
        val service = getSamlRegisteredServiceForTestShib();
        service.getAttributeValueTypes().put("customNameId", NameIDType.class.getSimpleName());

        val adaptor = SamlRegisteredServiceMetadataAdaptor
            .get(samlRegisteredServiceCachingMetadataResolver, service, service.getServiceId()).get();

        val buildContext = SamlProfileBuilderContext.builder()
            .samlRequest(getAuthnRequestFor(service))
            .httpRequest(new MockHttpServletRequest())
            .httpResponse(new MockHttpServletResponse())
            .authenticatedAssertion(Optional.of(getAssertion(Map.of("customNameId", List.of(UUID.randomUUID().toString())))))
            .registeredService(service)
            .adaptor(adaptor)
            .binding(SAMLConstants.SAML2_POST_BINDING_URI)
            .build();

        val statement = samlProfileSamlAttributeStatementBuilder.build(buildContext);
        val attributes = statement.getAttributes();
        assertFalse(attributes.isEmpty());
        val result = attributes.stream().filter(a -> "customNameId".equals(a.getName())).findFirst();
        assertTrue(result.isPresent());
        assertInstanceOf(NameIDType.class, result.get().getAttributeValues().getFirst());
    }
This is {@link SamlProfileSamlAttributeStatementBuilderTests}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-saml-idp/src/test/java/org/apereo/cas/support/saml/web/idp/profile/builders/attr/SamlProfileSamlAttributeStatementBuilderTests.java