You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by lp...@apache.org on 2017/10/26 09:32:22 UTC

[68/71] [abbrv] ambari git commit: AMBARI-21307 fixed test and implementation

AMBARI-21307 fixed test and implementation


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/25fa701c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/25fa701c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/25fa701c

Branch: refs/heads/feature-branch-AMBARI-21307
Commit: 25fa701c3818ea5021704d66f0e092823a1a07fb
Parents: 7800777
Author: lpuskas <lp...@apache.org>
Authored: Tue Oct 24 15:29:32 2017 +0200
Committer: lpuskas <lp...@apache.org>
Committed: Thu Oct 26 11:28:52 2017 +0200

----------------------------------------------------------------------
 .../server/ldap/service/ads/DefaultLdapConfigurationService.java  | 2 +-
 .../org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java   | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/25fa701c/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
index d80a636..3f6995c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConfigurationService.java
@@ -65,7 +65,7 @@ public class DefaultLdapConfigurationService implements LdapConfigurationService
     Boolean isConnected = ldapConnectionTemplate.execute(new ConnectionCallback<Boolean>() {
       @Override
       public Boolean doWithConnection(LdapConnection connection) throws LdapException {
-        return connection.isConnected();
+        return connection.isConnected() && connection.isAuthenticated();
       }
     });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/25fa701c/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
index c43e06c..0e05ed3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/ldap/LdapModuleFunctionalTest.java
@@ -19,7 +19,6 @@ import java.util.Map;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfigKeys;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration;
 import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationFactory;
-import org.apache.ambari.server.ldap.domain.TestAmbariLdapConfigurationFactory;
 import org.apache.ambari.server.ldap.service.ads.LdapConnectionTemplateFactory;
 import org.apache.ambari.server.ldap.service.ads.detectors.AttributeDetectorFactory;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
@@ -93,8 +92,6 @@ public class LdapModuleFunctionalTest {
     Boolean success = template.execute(new ConnectionCallback<Boolean>() {
       @Override
       public Boolean doWithConnection(LdapConnection connection) throws LdapException {
-        connection.unBind();
-        connection.bind(ldapConfiguration.bindDn(), ldapConfiguration.bindPassword());
 
         return connection.isConnected() && connection.isAuthenticated();
       }