private String deflateAndBase64(final String data) {
        val deflater = new Deflater();
        deflater.setInput(data.getBytes(StandardCharsets.UTF_8));
        deflater.finish();
        val buffer = new byte[data.length()];
        val resultSize = deflater.deflate(buffer);
        val output = new byte[resultSize];
        System.arraycopy(buffer, 0, output, 0, resultSize);
        return Base64.getEncoder().encodeToString(output);
    }
This class tests the {@link CasClient} class.

@author Jerome Leleu
@since 1.4.0
pac4j-cas/src/test/java/org/pac4j/cas/client/CasClientTests.java