@Test
    void verifySerializationToJson() throws IOException {
        val jsonFile = Files.createTempFile(RandomUtils.randomAlphabetic(8), ".json").toFile();
        val provider = new GroovyRegisteredServiceUsernameProvider();
        provider.setGroovyScript("groovy { return 'something' }");
        provider.setEncryptUsername(true);
        provider.setCanonicalizationMode("NONE");
        MAPPER.writeValue(jsonFile, provider);
        val repositoryRead = MAPPER.readValue(jsonFile, GroovyRegisteredServiceUsernameProvider.class);
        assertEquals(provider, repositoryRead);
    }
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