<commit_before><commit_msg>CMR-5099: Added system test for new placeholder logic for handling size estimate requests.<commit_after>(ns ^:system cmr.opendap.tests.system.app.size-estimate.core
  "Note: this namespace is exclusively for system tests; all tests defined
  here will use one or more system test fixtures.

  Definition used for system tests:
  * https://en.wikipedia.org/wiki/Software_testing#System_testing"
  (:require
    [clojure.test :refer :all]
    [cmr.opendap.http.request :as request]
    [cmr.opendap.testing.system :as test-system]
    [cmr.opendap.testing.util :as util]
    [org.httpkit.client :as httpc]
    [ring.util.codec :as codec]))

(use-fixtures :once test-system/with-system)

(deftest not-implemented
  (let [collection-id "C1200267318-HMR_TME"
        granule-id "G1200267320-HMR_TME"
        variable-id "V1200267322-HMR_TME"
        options (-> {}
                    (request/add-token-header (util/get-sit-token)))]
    (testing "GET without bounding box ..."
      (let [response @(httpc/get
                       (format (str "http://localhost:%s"
                                    "/opendap/size-estimate/collection/%s"
                                    "?granules=%s"
                                    "&variables=%s")
                               (test-system/http-port)
                               collection-id
                               granule-id
                               variable-id)
                       options)]
        (is (= 400 (:status response)))
        (is (= "cmr-opendap.v2.1; format=json"
               (get-in response [:headers :cmr-media-type])))
        (is (= {:errors ["sizing estimate not-implemented"]}
               (util/parse-response response)))))))
{'fraction_non_alphanumeric': 0.12107367218732153, 'fraction_numerical': 0.02227298686464877, 'mean_word_length': 1.8303715670436187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7056332', 'n_tokens_mistral': 550, 'n_tokens_neox': 504, 'n_words': 112}