@Test
    void verifyNoPublicKey() throws Throwable {
        val policy = new ReturnEncryptedAttributeReleasePolicy(CollectionUtils.wrapList("cn"));
        val registeredService = CoreAuthenticationTestUtils.getRegisteredService();

        val context = RegisteredServiceAttributeReleasePolicyContext.builder()
            .applicationContext(applicationContext)
            .registeredService(registeredService)
            .service(CoreAuthenticationTestUtils.getService())
            .principal(CoreAuthenticationTestUtils.getPrincipal("casuser"))
            .build();
        var results = policy.getAttributes(context);
        assertTrue(results.isEmpty());

        val servicePublicKey = new RegisteredServicePublicKeyImpl();
        when(registeredService.getPublicKey()).thenReturn(servicePublicKey);
        results = policy.getAttributes(context);
        assertTrue(results.isEmpty());
    }
This is {@link ReturnEncryptedAttributeReleasePolicyTests}.

@author Misagh Moayyed
@since 6.2.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/ReturnEncryptedAttributeReleasePolicyTests.java