public static String selectDesensitize(final String source, final String algorithm) {
        ShenyuDataDesensitize dataDesensitize = ExtensionLoader.getExtensionLoader(ShenyuDataDesensitize.class).getJoin(algorithm);
        return dataDesensitize.desensitize(source);
    }
@Test
    public void selectDesensitizeTest() {
        // EMPTY_STRING
        String emptyStr = DataDesensitizeFactory.selectDesensitize("", DataDesensitizeEnum.MD5_ENCRYPT.getDataDesensitizeAlg());
        Assertions.assertEquals("", emptyStr);

        // test for md5
        String sourceData = "123456789";
        String desensitizedData = DataDesensitizeFactory.selectDesensitize(sourceData, DataDesensitizeEnum.MD5_ENCRYPT.getDataDesensitizeAlg());
        Assertions.assertEquals(DigestUtils.md5Hex(sourceData), desensitizedData);

        // test for replacement
        String replaceText = DataDesensitizeFactory.selectDesensitize(sourceData, DataDesensitizeEnum.CHARACTER_REPLACE.getDataDesensitizeAlg());
        String maskData = "123456789";
        int maskNum = 0;
        for (char c : replaceText.toCharArray()) {
            if (c == '*') {
                maskNum++;
            }
        }
        Assertions.assertEquals(maskData.length() / 2, maskNum);
    }