           dataset-ids (map #(:dataset-id %) references)]
       (is (= 2 (count references)))
       (is (= #{"OneCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by dataset id using wildcard *."
-    (let [references (search/find-collection-refs {:dataset_id "O*", "options[dataset_id][pattern]" "true"})
+  (t/testing "search by dataset id using wildcard *." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "O*", "options[dataset_id][pattern]" "true"})
           dataset-ids (map #(:dataset-id %) references)]
       (is (= 3 (count references)))
       (is (= #{"OneCollectionV1" "OtherCollectionV1"} (into #{} dataset-ids)))))
-  (testing "search by dataset id case not match."
-    (let [references (search/find-collection-refs {:dataset_id "minimalCollectionV1"})]
-      (is (= 0 (count references)))))
-  (testing "search by dataset id ignore case."
-    (let [references (search/find-collection-refs {:dataset_id "minimalCollectionV1", "options[dataset_id][ignore_case]" "true"})]
+  (t/testing "search by dataset id case not match." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "minimalCollectionV1"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by dataset id ignore case false." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "minimalCollectionV1", "options[dataset_id][ignore_case]" "false"})]
+      (is (= 0 (count references)))))
+  (t/testing "search by dataset id ignore case true." [context]
+    (let [references (search/find-collection-refs context {:dataset_id "minimalCollectionV1", "options[dataset_id][ignore_case]" "true"})]
       (is (= 1 (count references)))
       (let [{dataset-id :dataset-id} (first references)]
         (is (= "MinimalCollectionV1" dataset-id))))))

      (is (= 3 (count references)))
      (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1"}
            (map #(:dataset-id %) references))))
  (testing "search by provider id using wildcard *."
    (let [references (search/find-collection-refs {:provider "CMR_PRO*", "options[provider][pattern]" "true"})]
      (is (= 5 (count references)))
      (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1" "OtherCollectionV1"}
            (map #(:dataset-id %) references))))
  (testing "search by provider id using wildcard ?."
    (let [references (search/find-collection-refs {:provider "CMR_PROV?", "options[provider][pattern]" "true"})]
      (is (= 5 (count references)))
      (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1" "OtherCollectionV1"}
            (map #(:dataset-id %) references))))
  (testing "search by provider id case not match."
    (let [references (search/find-collection-refs {:provider "CMR_prov1"})]
      (is (= 0 (count references)))))
  (testing "search by provider id ignore case."
    (let [references (search/find-collection-refs {:provider "CMR_prov1", "options[provider][ignore_case]" "true"})]
      (is (= 3 (count references)))
      (some #{"MinimalCollectionV1" "OneCollectionV1" "AnotherCollectionV1" "OtherCollectionV1"}
            (map #(:dataset-id %) references)))))

          dataset-ids (map #(:dataset-id %) references)]
      (is (= 2 (count references)))
      (is (= #{"OneCollectionV1"} (into #{} dataset-ids)))))
  (t/testing "search by version using wildcard *." [context]
    (let [references (search/find-collection-refs context {:version "r*", "options[version][pattern]" "true"})
          dataset-ids (map #(:dataset-id %) references)]
      (is (= 2 (count references)))
      (is (= #{"OtherCollectionV1" "AnotherCollectionV1"} (into #{} dataset-ids)))))
  (t/testing "search by version using wildcard ?." [context]
    (let [references (search/find-collection-refs context {:version "r?", "options[version][pattern]" "true"})
          dataset-ids (map #(:dataset-id %) references)]
      (is (= 2 (count references)))
      (is (= #{"OtherCollectionV1" "AnotherCollectionV1"} (into #{} dataset-ids)))))
  (t/testing "search by version case not match." [context]
    (let [references (search/find-collection-refs context {:version "R1"})]
      (is (= 0 (count references)))))
  (t/testing "search by version ignore case false." [context]
    (let [references (search/find-collection-refs context {:version "R1", "options[version][ignore_case]" "false"})]
      (is (= 0 (count references)))))
  (t/testing "search by version ignore case true." [context]
    (let [references (search/find-collection-refs context {:version "R1", "options[version][ignore_case]" "true"})]
      (is (= 1 (count references)))
      (let [{dataset-id :dataset-id} (first references)]
        (is (= "AnotherCollectionV1" dataset-id))))))
