@Test
    void verifyUsernameProviderInlineWithoutAttribute() throws Throwable {
        val provider = new GroovyRegisteredServiceUsernameProvider();
        provider.setGroovyScript("groovy { return attributes['unknown-attribute'][0] + '123456789' }");

        val usernameContext = RegisteredServiceUsernameProviderContext.builder()
            .registeredService(RegisteredServiceTestUtils.getRegisteredService())
            .service(RegisteredServiceTestUtils.getService())
            .applicationContext(applicationContext)
            .principal(RegisteredServiceTestUtils.getPrincipal("casuser"))
            .build();
        val id = provider.resolveUsername(usernameContext);
        assertEquals("casuser", id);
    }
This is {@link GroovyRegisteredServiceUsernameProviderTests}.

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