             _ (index/wait-until-indexed)
 
             ;;Search for the grid again, it should NOT return the association
-            grid-search-result1 (search-request "grids.json" "name=Grid-A7-v1")
-            grid-search-body1 (json/parse-string (:body grid-search-result1) true)
-            grid-search-generic-associations1 (get-in (first (:items grid-search-body1)) [:associations])
+            grid-search-result1 (get-associations-and-details "grids.json" "name=Grid-A7-v1" :variables false)
 
             ;;Search for the variable again, it should NOT return the association
-            var1-search-result1 (search-request "variables.umm_json" "native_id=var1")
-            var1-search-body1 (json/parse-string (:body var1-search-result1) true)
-            var1-search-generic-associations1 (get-in (first (:items var1-search-body1)) [:associations :grids])]
+            var1-search-result1 (get-associations-and-details "variables.umm_json" "native_id=var1" :grids false)]
         ;; The first and second associations are successful
         (is (= 200 (:status response1) (:status response2)))
 


        ;; Search for the grid returns the tl1 as generic association
        (is (= [tl1-concept-id]
               grid-search-generic-associations))
        (is (= [{:concept-id tl1-concept-id :revision-id tl1-revision-id}]
               grid-search-generic-association-details))

        ;; Search for the tool returns the grid as generic association
        (is (= [grid-concept-id]
               tl1-search-generic-associations))

        ;; Dissociation of the association is successful
        (is (= 200 (:status response4)))

        ;; Search for the grid again doesn't return the tl1 as generic association
        (is (= nil grid-search-generic-associations1))

        ;; Search for the tool again doesn't return the grid as generic association
        (is (= nil  tl1-search-generic-associations1))))))

;; Test that generic associations can be made between generic documents and services.
;; Also test the collection-service associations through the old association api and verify

            _ (index/wait-until-indexed)

            ;;Search for the grid again, it should NOT return the association
            grid-search-result1 (get-associations-and-details "grids.json" "name=Grid-A7-v1" :collections false)

            ;;Search for the collection again, it should NOT return the association
            coll-search-result1 (get-associations-and-details "collections.umm-json" "entry_title=entry-title1" :grids true)]

        ;; The first and second associations are successful
        (is (= 200 (:status response1) (:status response2)))
