     (index/refresh-elastic-index)
 
     (testing "parameter search acl enforcement"
-     (are [token items]
-             (d/refs-match? items (search/find-refs :collection (when token {:token token})))
+      (are [token items]
+           (d/refs-match? items (search/find-refs :collection (when token {:token token})))
 
-             ;; not logged in should be guest
-             nil [coll1 coll4 coll6 coll7]
+           ;; not logged in should be guest
+           nil [coll1 coll4 coll6 coll7 coll8]
 
-             ;; login and use guest token
-             guest-token [coll1 coll4 coll6 coll7]
+           ;; login and use guest token
+           guest-token [coll1 coll4 coll6 coll7 coll8]
 
-             ;; test searching as a user
-             user1-token [coll2 coll4]
+           ;; test searching as a user
+           user1-token [coll2 coll4]
 
-             ;; Test searching with users in groups
-             user2-token [coll2 coll4 coll3]
-             user3-token [coll2 coll4 coll3 coll6]))
+           ;; Test searching with users in groups
+           user2-token [coll2 coll4 coll3]
+           user3-token [coll2 coll4 coll3 coll6 coll8]))
     (testing "token can be sent through a header"
       (is (d/refs-match? [coll2 coll4]
                          (search/find-refs :collection {} {:headers {"Echo-Token" user1-token}}))))


(use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1" "provguid2" "PROV2"} false))

;; TODO add test for searching with an invalid security token.

(deftest collection-search-with-acls-test

        ;; PROV2
        coll6 (d/ingest "PROV2" (dc/collection {:entry-title "coll6"}))
        coll7 (d/ingest "PROV2" (dc/collection {:entry-title "coll7"}))
        ;; A dif collection
        coll8 (d/ingest "PROV2" (dc/collection {:entry-title "coll8"
                                                :entry-id "S8"
                                                :short-name "S8"
                                                :version-id "V8"
                                                :long-name "coll8"}) :dif)

        all-colls [coll1 coll2 coll3 coll4 coll5 coll6 coll7 coll8]
        guest-token (e/login-guest)
        user1-token (e/login "user1")
        user2-token (e/login "user2" ["group-guid1"])
