@Test public void testHideInJson() { String testData = "username\":\"admin\",\"external_ranger_admin_password\":\"rangerpassword123\"}}}," + "{\"admin-properties\":{\"properties\":{\"db_root_user\":\"rangerroot\",\"db_root_password\":\"rangerpass\",\"db_host\":\"localhost\"}}}"; Assert.assertEquals("username\":\"admin\",\"external_ranger_admin_password\":\"" + REPLACEMENT + "\"}}}," + "{\"admin-properties\":{\"properties\":{\"db_root_user\":\"rangerroot\",\"db_root_password\":\"" + REPLACEMENT + "\",\"db_host\":\"localhost\"}}}", anonymize(testData)); }
public static String anonymize(String content) { String ret = content; if (ret != null) { LOGGER.info("Anonymize the content with length: {}", content.length()); for (ReplacePattern pattern : PATTERNS) { ret = pattern.replaceAll(ret); } } return ret; }
AnonymizerUtil { public static String anonymize(String content) { String ret = content; if (ret != null) { LOGGER.info("Anonymize the content with length: {}", content.length()); for (ReplacePattern pattern : PATTERNS) { ret = pattern.replaceAll(ret); } } return ret; } }
AnonymizerUtil { public static String anonymize(String content) { String ret = content; if (ret != null) { LOGGER.info("Anonymize the content with length: {}", content.length()); for (ReplacePattern pattern : PATTERNS) { ret = pattern.replaceAll(ret); } } return ret; } private  AnonymizerUtil(); }
AnonymizerUtil { public static String anonymize(String content) { String ret = content; if (ret != null) { LOGGER.info("Anonymize the content with length: {}", content.length()); for (ReplacePattern pattern : PATTERNS) { ret = pattern.replaceAll(ret); } } return ret; } private  AnonymizerUtil(); static String anonymize(String content); }
AnonymizerUtil { public static String anonymize(String content) { String ret = content; if (ret != null) { LOGGER.info("Anonymize the content with length: {}", content.length()); for (ReplacePattern pattern : PATTERNS) { ret = pattern.replaceAll(ret); } } return ret; } private  AnonymizerUtil(); static String anonymize(String content); static final String REPLACEMENT; }