Browse files

Allow empty entries with :dn set

  • Loading branch information...
1 parent f8d56f2 commit 9acf5ff582ea9431584b149efb9fc065ccf12f15 @alienscience committed Feb 10, 2011
Showing with 5 additions and 6 deletions.
  1. +4 −5 src/clj_ldap/client.clj
  2. +1 −1 test/clj_ldap/test/client.clj
View
9 src/clj_ldap/client.clj
@@ -131,11 +131,10 @@
(defn- entry-as-map
"Converts an Entry object into a map"
[entry]
- (let [col-a (.getAttributes entry)]
- (if (> (.size col-a) 0)
- (let [attrs (seq col-a)]
- (apply hash-map :dn (.getDN entry)
- (mapcat extract-attribute attrs))))))
+ (let [col-a (.getAttributes entry)
+ attrs (seq (.getAttributes entry))]
+ (apply hash-map :dn (.getDN entry)
+ (mapcat extract-attribute attrs))))
(defn- set-entry-kv!
"Sets the given key/value pair in the given entry object"
View
2 test/clj_ldap/test/client.clj
@@ -181,7 +181,7 @@
(deftest test-search
(is (= (set (map :cn
(ldap/search *conn* base* {:attributes [:cn]})))
- (set ["testa" "testb" "Saul Hazledine"])))
+ (set [nil "testa" "testb" "Saul Hazledine"])))
(is (= (set (map :cn
(ldap/search *conn* base*
{:attributes [:cn] :filter "cn=test*"})))

0 comments on commit 9acf5ff

Please sign in to comment.