@SuppressWarnings("checkstyle:MagicNumber")
    @Test
    void ensurePaddingShouldAddEnoughEquals() {
        CookieRememberMeManager mgr = new CookieRememberMeManager();
        StringBuilder stringToTest = new StringBuilder("A string to test padding");
        for (int i = 0; i < 10; i++) {
            stringToTest.append("x");
            String encoded = Base64.encodeToString(stringToTest.toString().getBytes());
            while (encoded.endsWith("=")) {
                encoded = encoded.substring(0, encoded.length() - 1);
            }
            String base64 = mgr.ensurePadding(encoded);
            assertDoesNotThrow(() -> Base64.decode(base64), "Error decoding " + stringToTest);
        }
    }
Unit tests for the {@link CookieRememberMeManager} implementation.

@since 1.0
web/src/test/java/org/apache/shiro/web/mgt/CookieRememberMeManagerTest.java