<commit_before>(ns ^{:doc "provides search related utilities."}
  cmr.system-int-test.search-util
  (:require [clojure.test :refer :all]
            [clj-http.client :as client]
            [clojure.string :as str]
            [cheshire.core :as cheshire]
            [cmr.system-int-test.url-helper :as url]))

(defn find-collection-refs
  "Returns the collection references that are found
  by searching with the input params"
  [params]
  (let [url (str (url/collection-search-url params))
        response (client/get url {:accept :json})
        body (:body response)
        result (cheshire/decode body)
        references (result "references")]
    (is (= 200 (:status response)))
    (map (fn [x]
           (let [{:strs [entry-title concept-id revision-id]} x]
             {:dataset-id entry-title
              :concept-id concept-id
              :revision-id revision-id}))
         references)))<commit_msg>Updated tests for the Reference naming change.<commit_after>(ns ^{:doc "provides search related utilities."}
  cmr.system-int-test.search-util
  (:require [clojure.test :refer :all]
            [clj-http.client :as client]
            [clojure.string :as str]
            [cheshire.core :as cheshire]
            [cmr.system-int-test.url-helper :as url]))

(defn find-collection-refs
  "Returns the collection references that are found
  by searching with the input params"
  [params]
  (let [url (str (url/collection-search-url params))
        response (client/get url {:accept :json})
        body (:body response)
        result (cheshire/decode body)
        references (result "references")]
    (is (= 200 (:status response)))
    (map (fn [x]
           (let [{:strs [name concept-id revision-id]} x]
             {:dataset-id name
              :concept-id concept-id
              :revision-id revision-id}))
         references)))
{'fraction_non_alphanumeric': 0.12721417069243157, 'fraction_numerical': 0.00322061191626409, 'mean_word_length': 2.389090909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4541941', 'n_tokens_mistral': 566, 'n_tokens_neox': 550, 'n_words': 161}