### Question:
BaseDataSource { public String getPassword() { return CommonUtils.decodePassword(password); }  String getPrincipal(); void setPrincipal(String principal); abstract String driverClassSelector(); abstract DbType dbTypeSelector(); String getJdbcUrl(); void isConnectable(); String getUser(); void setUser(String user); String getPassword(); void setPassword(String password); void setAddress(String address); String getAddress(); String getDatabase(); void setDatabase(String database); String getOther(); void setOther(String other);  }### Answer:
@Test public void testGetPassword() { BaseDataSource dataSource = new BaseDataSource() { @Override public String driverClassSelector() { return null; } @Override public DbType dbTypeSelector() { return null; } }; String password= ""; dataSource.setPassword(password); Assert.assertEquals("", dataSource.getPassword()); password= "IUAjJCVeJipNVEl6TkRVMg=="; dataSource.setPassword(password); Assert.assertNotNull(dataSource.getPassword()); Assert.assertNotNull(dataSource.getPassword()); dataSource.setPassword(password); PropertyUtils.setValue(Constants.DATASOURCE_ENCRYPTION_ENABLE,"true"); Assert.assertEquals("123456", dataSource.getPassword()); dataSource.setPassword(password); Assert.assertEquals("123456", dataSource.getPassword()); Assert.assertEquals("123456", dataSource.getPassword()); Assert.assertEquals("123456", dataSource.getPassword()); dataSource.setPassword(password); PropertyUtils.setValue(Constants.DATASOURCE_ENCRYPTION_ENABLE,"false"); Assert.assertEquals("IUAjJCVeJipNVEl6TkRVMg==", dataSource.getPassword()); dataSource.setPassword(password); Assert.assertEquals("IUAjJCVeJipNVEl6TkRVMg==", dataSource.getPassword()); Assert.assertEquals("IUAjJCVeJipNVEl6TkRVMg==", dataSource.getPassword()); Assert.assertEquals("IUAjJCVeJipNVEl6TkRVMg==", dataSource.getPassword()); }