@Test
    void verifyDefinitions() {
        val defn1 = DefaultAttributeDefinition.builder()
            .key("cn")
            .encrypted(true)
            .build();
        val defn2 = DefaultAttributeDefinition.builder()
            .key("cn")
            .build();
        assertEquals(0, defn1.compareTo(defn2));

        try (val store = new DefaultAttributeDefinitionStore(defn1)) {
            store.setScope("example.org");

            val service = CoreAuthenticationTestUtils.getRegisteredService();

            val context = AttributeDefinitionResolutionContext.builder()
                .attributeValues(List.of("common-name"))
                .principal(CoreAuthenticationTestUtils.getPrincipal())
                .registeredService(service)
                .service(CoreAuthenticationTestUtils.getService())
                .attributes(Map.of())
                .build();

            var results = store.resolveAttributeValues("cn", context);
            assertFalse(results.isEmpty());
            assertTrue(results.get().getValue().isEmpty());

            when(service.getPublicKey()).thenReturn(mock(RegisteredServicePublicKey.class));
            results = store.resolveAttributeValues("cn", context);
            assertTrue(results.get().getValue().isEmpty());
        }
    }
This is {@link DefaultAttributeDefinitionStoreTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-person-directory/src/test/java/org/apereo/cas/DefaultAttributeDefinitionStoreTests.java