@Test
    void verifyInlineGroovyScript() {
        assertTrue(ScriptingUtils.isInlineGroovyScript("groovy {return 0}"));
        val script = ScriptingUtils.parseGroovyShellScript("return authentication.principal.id + ' @ ' + authentication.authenticationDate");
        val authn = mock(Authentication.class);
        when(authn.getAuthenticationDate()).thenReturn(ZonedDateTime.now(Clock.systemUTC()));
        val principal = mock(Principal.class);
        when(principal.getId()).thenReturn("casuser");
        when(authn.getPrincipal()).thenReturn(principal);
        val result = ScriptingUtils.executeGroovyShellScript(script, Map.of("authentication", authn), String.class);
        assertTrue(Objects.requireNonNull(result).startsWith("casuser"));
    }
This is {@link ScriptingUtilsTests}.

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