@SuppressWarnings("unchecked") public void validateLdapConfig(LdapConnectionInfoDTO connInfo) throws Exception { CConnectionInfo fileConfig = LdapConfigurationUtil.getConfiguration().getConnectionInfo(); Assert.assertEquals(connInfo.getAuthScheme(), fileConfig.getAuthScheme()); Assert.assertEquals(connInfo.getHost(), fileConfig.getHost()); Assert.assertEquals(connInfo.getPort(), fileConfig.getPort()); Assert.assertEquals(connInfo.getProtocol(), fileConfig.getProtocol()); Assert.assertEquals(connInfo.getRealm(), fileConfig.getRealm()); Assert.assertEquals(connInfo.getSearchBase(), fileConfig.getSearchBase()); Assert.assertEquals(connInfo.getSystemUsername(), fileConfig.getSystemUsername()); // if the expectedPassword == null then the actual should be null if (connInfo.getSystemPassword() == null) { Assert.assertNull(fileConfig.getSystemPassword()); } else { // make sure its not clear text Assert.assertNotSame(connInfo.getSystemPassword(), fileConfig.getSystemPassword()); Assert.assertTrue(fileConfig.getSystemPassword().length() > 0); } }