### Question:
CommonUtils { public static String encodePassword(String password) { if (StringUtils.isEmpty(password)) { return StringUtils.EMPTY; } boolean encryptionEnable = PropertyUtils.getBoolean(Constants.DATASOURCE_ENCRYPTION_ENABLE, false); if (!encryptionEnable) { return password; } String salt = PropertyUtils.getString(Constants.DATASOURCE_ENCRYPTION_SALT, Constants.DATASOURCE_ENCRYPTION_SALT_DEFAULT); String passwordWithSalt = salt + new String(BASE64.encode(password.getBytes(StandardCharsets.UTF_8))); return new String(BASE64.encode(passwordWithSalt.getBytes(StandardCharsets.UTF_8))); } private  CommonUtils(); static String getSystemEnvPath(); static boolean isDevelopMode(); static boolean getKerberosStartupState(); static void loadKerberosConf(); static String encodePassword(String password); static String decodePassword(String password);  }### Answer:
@Test public void encodePassword() { PropertyUtils.setValue(Constants.DATASOURCE_ENCRYPTION_ENABLE,"true"); Assert.assertEquals("",CommonUtils.encodePassword("")); Assert.assertEquals("IUAjJCVeJipNVEl6TkRVMg==",CommonUtils.encodePassword("123456")); Assert.assertEquals("IUAjJCVeJipJVkZCV2xoVFYwQT0=",CommonUtils.encodePassword("!QAZXSW@")); Assert.assertEquals("IUAjJCVeJipOV1JtWjJWeUtFQT0=",CommonUtils.encodePassword("5dfger(@")); PropertyUtils.setValue(Constants.DATASOURCE_ENCRYPTION_ENABLE,"false"); Assert.assertEquals("",CommonUtils.encodePassword("")); Assert.assertEquals("123456",CommonUtils.encodePassword("123456")); Assert.assertEquals("!QAZXSW@",CommonUtils.encodePassword("!QAZXSW@")); Assert.assertEquals("5dfger(@",CommonUtils.encodePassword("5dfger(@")); }