             [cmr.common.util :refer [update-in-each]]
             [cmr.common.test.test-check-ext :as ext :refer [defspec]]
             [cmr.umm-spec.test.expected-conversion :as expected-conversion]
+            [cmr.umm-spec.test.umm-record-sanitizer :as urs]
             [cmr.umm-spec.core :as core]
             [cmr.umm-spec.simple-xpath :refer [select context]]
             [cmr.umm-spec.xml-to-umm-mappings.iso19115-2 :as iso-xml-to-umm]

            metadata-format (gen/elements [:echo10 :dif :dif10 :iso-smap :iso19115])]
    (is (= (expected-conversion/convert umm-record metadata-format)
           (xml-round-trip umm-record metadata-format)))))

(defn- parse-iso19115-projects-keywords
  "Returns the parsed projects keywords for the given ISO19115-2 xml"

    ;; explicit on those enumeration values and other things, we can't turn validation on xml on.
    ;; See CMR-1990
    ; (is (empty? (core/validate-xml :collection format metadata-xml)))
    (core/parse-metadata :collection format metadata-xml)))

;; TODO: This is added temporarily to make sure we don't break the xml schema validations that
;; are currently working. We will remove this function and the test when all metadata formats
;; can turn on the xml validation.
(defn new-xml-round-trip
  "Returns record after being converted to XML and back to UMM through
  the given to-xml and to-umm mappings."
  [record format]
  (let [metadata-xml (core/generate-metadata :collection format record)]
    ;; validate xml
    ;; Since our UMM JSON schema is not complete in defining things like enumeration values for
    ;; controlled vocabulary fields, the generator generated fields would not create validate field
    ;; values for those fields (e.g. Dataset_Language field). Until we change the schema to be
    ;; explicit on those enumeration values and other things, we can't turn validation on xml on.
    ;; See CMR-1990
    (is (empty? (core/validate-xml :collection format metadata-xml)))
    (core/parse-metadata :collection format metadata-xml)))

(deftest roundtrip-gen-parse
