@Test
    void verifyReleaseRules() throws Throwable {
        System.setProperty("MYKEY", UUID.randomUUID().toString());

        val policy = new ReturnEnvironmentAttributeReleasePolicy();
        policy.setEnvironmentVariables(CollectionUtils.wrap("JAVA_OPTS", "JAVA"));
        policy.setSystemProperties(CollectionUtils.wrap("MYKEY", "KEY"));

        val principal = CoreAuthenticationTestUtils.getPrincipal();
        val registeredService = CoreAuthenticationTestUtils.getRegisteredService();
        when(registeredService.getAttributeReleasePolicy()).thenReturn(policy);

        val releasePolicyContext = RegisteredServiceAttributeReleasePolicyContext.builder()
            .registeredService(registeredService)
            .service(CoreAuthenticationTestUtils.getService())
            .applicationContext(applicationContext)
            .principal(principal)
            .build();
        val results = policy.getAttributes(releasePolicyContext);
        assertEquals(3, results.size());
        assertTrue(results.containsKey("JAVA"));
        assertTrue(results.containsKey("KEY"));
        assertTrue(results.containsKey("applicationProfiles"));
    }
This is {@link ReturnEnvironmentAttributeReleasePolicyTests}.

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