public static String mask(String info, String passwordPattern, String mask) {
        if (null == info || null == passwordPattern || null == mask) {
            return info;
        }
        Pattern p = Pattern.compile(passwordPattern);
        Matcher m = p.matcher(info);
        StringBuffer sb = new StringBuffer();
        while (m.find()) {
            m.appendReplacement(sb, mask);
        }
        m.appendTail(sb);

        return sb.toString();
    }
@Test
    public void testMask() {
        String sql = "stock_trade:='connector' ="
                + " 'jdbc',useUnicode=yes&characterEncoding=UTF-8&useSSL=false',\\n"
                + "   'username' = 'trade',\\n"
                + " 'password' = 'c6634672b535f968b'\\n"
                + ";\\n"
                + "tidb_test:='connector' = 'jdbc',\\n"
                + "'url' ="
                + " 'jdbc:mysql://localhost:4000/test?useUnicode=yes&characterEncoding=UTF-8&useSSL=false',\\n"
                + "   'username' = 'root',\\n"
                + " 'password' = 'wwz@test'\\n"
                + ";";

        String out = SecurityAspect.mask(sql, SecurityAspect.SENSITIVE, SecurityAspect.MASK);

        Assert.assertEquals(out.contains(SecurityAspect.MASK), true);
    }