@Test
    void verifyOperation() throws Throwable {
        val file = File.createTempFile("scripted", ".groovy");
        FileUtils.writeStringToFile(file, "println 'hello'", StandardCharsets.UTF_8);

        val scriptFactory = ExecutableCompiledScriptFactory.getExecutableCompiledScriptFactory();
        val resource = scriptFactory.fromResource(new FileSystemResource(file));

        val id = UUID.randomUUID().toString();
        assertNull(cacheManager.get(id));

        assertFalse(cacheManager.containsKey(id));

        cacheManager.put(id, resource);
        cacheManager.put(id, resource);
        assertTrue(cacheManager.containsKey(id));
        assertNotNull(cacheManager.get(id));

        cacheManager.remove(id);
        assertFalse(cacheManager.containsKey(id));

        cacheManager.put(id, resource);
        cacheManager.clear();
        assertTrue(cacheManager.isEmpty());
        cacheManager.destroy();
    }
This is {@link GroovyScriptResourceCacheManagerTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-scripting/src/test/java/org/apereo/cas/util/GroovyScriptResourceCacheManagerTests.java