 (deftest revision-id-validations
   (testing "ingesting a concept with the same concept-id and revision-id fails"
     (let [concept-id "C1-PROV1"
-          existing-concept (dc/collection-concept {:revision-id 1 :concept-id concept-id})
+          existing-concept (data-umm-c/collection-concept {:EntryTitle "E1" :ShortName "S1" :revision-id 1 :concept-id concept-id})
           _ (ingest/ingest-concept existing-concept)
           response (ingest/ingest-concept existing-concept)]
       (is (= {:status 409

  "CMR Ingest revision validation integration tests"
  (:require
    [clojure.test :refer :all]
    [cmr.system-int-test.utils.ingest-util :as ingest]
    [cmr.system-int-test.data2.collection :as dc]
    [cmr.ingest.services.messages :as msg]))

(defn- assert-revision-conflict
  [concept-id format-str response]

(deftest revision-conflict-tests
  (testing "Update with lower revision id should be rejected 
            if it comes after an concept with a higher revision id"
    (let [concept (data-umm-c/collection-concept {:EntryTitle "E1" :ShortName "S1" :revision-id 4})
          concept-id (:concept-id (ingest/ingest-concept concept))
          response (ingest/ingest-concept (assoc concept :revision-id 2))]
      (assert-revision-conflict concept-id "Expected revision-id of [5] got [2] for [%s]" response)))

  (testing "Delete with lower revision id than latest concept should be rejected"
    (let [concept (data-umm-c/collection-concept {:EntryTitle "E2" :ShortName "S2" :revision-id 4})
          concept-id (:concept-id (ingest/ingest-concept concept))
          response (ingest/delete-concept concept {:revision-id 2})]
      (assert-revision-conflict concept-id "Expected revision-id of [5] got [2] for [%s]" response)))

  (testing "Ingest with lower revision id than latest tombstone should be rejected"
    (let [concept (data-umm-c/collection-concept {:EntryTitle "E3" :ShortName "S3"})
          concept-id (:concept-id (ingest/ingest-concept concept))
          _ (ingest/delete-concept concept {:revision-id 5})
          response (ingest/ingest-concept (assoc concept :revision-id 3))]
      (assert-revision-conflict concept-id "Expected revision-id of [6] got [3] for [%s]" response)))

  (testing "Delete with lower revision id than latest tombstone results in a 404"
    (let [concept (data-umm-c/collection-concept {:EntryTitle "E4" :ShortName "S4"})
          concept-id (:concept-id (ingest/ingest-concept concept))
          _ (ingest/delete-concept concept {:revision-id 5})
          {:keys [status errors]} (ingest/delete-concept concept {:revision-id 3})]
