@Test
    void verifyServiceAttributeFilterAllAttributes() throws Throwable {
        prepareService();
        baseService.setAttributeReleasePolicy(new ReturnAllAttributeReleasePolicy());
        val p = mock(Principal.class);
        val map = new HashMap<String, List<Object>>();
        map.put(ATTR_1, List.of("value1"));
        map.put(ATTR_2, List.of("value2"));
        map.put(ATTR_3, Arrays.asList("v3", "v4"));
        when(p.getAttributes()).thenReturn(map);
        when(p.getId()).thenReturn("principalId");

        val context = RegisteredServiceAttributeReleasePolicyContext.builder()
            .registeredService(RegisteredServiceTestUtils.getRegisteredService(SERVICE_ID))
            .service(RegisteredServiceTestUtils.getService())
            .applicationContext(applicationContext)
            .principal(p)
            .build();
        val attr = baseService.getAttributeReleasePolicy().getAttributes(context);
        assertEquals(attr.size(), map.size());
    }
Unit test for {@link BaseRegisteredService}.

@author Marvin S. Addison
@since 3.4.12
core/cas-server-core-services/src/test/java/org/apereo/cas/services/RegisteredServiceTests.java