@Test
    void verifyPolicy() throws Throwable {
        val data = MAPPER.writeValueAsString(CollectionUtils.wrap("givenName", "CASUSER", "familyName", "CAS"));
        try (val webServer = new MockWebServer(new ByteArrayResource(data.getBytes(StandardCharsets.UTF_8), "REST Output"), MediaType.APPLICATION_JSON_VALUE)) {
            webServer.start();
            val policyWritten = new ReturnRestfulAttributeReleasePolicy()
                .setEndpoint("http://localhost:%s".formatted(webServer.getPort()));
            val releasePolicyContext = RegisteredServiceAttributeReleasePolicyContext.builder()
                .registeredService(CoreAuthenticationTestUtils.getRegisteredService())
                .service(CoreAuthenticationTestUtils.getService())
                .principal(CoreAuthenticationTestUtils.getPrincipal())
                .applicationContext(applicationContext)
                .build();
            val attributes = policyWritten.getAttributes(releasePolicyContext);
            assertFalse(attributes.isEmpty());
        }
    }
This is {@link ReturnRestfulAttributeReleasePolicyTests}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-authentication-attributes/src/test/java/org/apereo/cas/services/ReturnRestfulAttributeReleasePolicyTests.java