           granule (util/granule-concept "PROV1" "C1000000000-PROV1" 5)
           {:keys [concept-id revision-id]} (util/ingest-granule granule)]
       (is (util/concept-exists-in-mdb? concept-id revision-id))
-      (is (= revision-id 0)))))
+      (is (= 0 revision-id)))))
 
 ; Verify a new granule with concept-id is ingested successfully.
 (deftest granule-w-concept-id-ingest-test

        delete-revision-id (:revision-id delete-result)]
    (is (= 1 (- delete-revision-id ingest-revision-id)))))

;; Verify ingest behaves properly if request is missing content type.
(deftest missing-content-type-ingest-test
  (let [collection (util/collection-concept "PROV1" 5)
        _ (util/ingest-collection collection)
        granule-with-no-content-type  (assoc (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1") :content-type "")
        {:keys [status errors-str]} (util/ingest-granule granule-with-no-content-type)]
    (is (= status 400))
    (is (re-find #"Invalid content-type" errors-str))))

;; Verify ingest behaves properly if request contains invalid  content type.
(deftest invalid-content-type-ingest-test
  (let [collection (util/collection-concept "PROV1" 5)
        _ (util/ingest-collection collection)
        granule-with-no-content-type (assoc (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1") :content-type "blah")
        {:keys [status errors-str]} (util/ingest-granule granule-with-no-content-type)]
    (is (= status 400))
    (is (re-find #"Invalid content-type" errors-str))))

;; Verify deleting same granule twice is not an error if ignore conflict is true.
(deftest delete-same-granule-twice-test
  (let [collection (util/collection-concept "PROV1" 5)
        _ (util/ingest-collection collection)
        granule (util/granule-concept "PROV1" "C1000000000-PROV1" 5 "G1-PROV1")
        ingest-result (util/ingest-granule granule)
        delete1-result (util/delete-concept granule)
        delete2-result (util/delete-concept granule)]
    (is (= 200 (:status ingest-result)))
    (is (= 200 (:status delete1-result)))
    (is (= 200 (:status delete2-result)))))


;;; Fixtures

            [clojure.string :as string]
            [cmr.system-int-test.utils.ingest-util :as util]))

;;;; tests
;;; ensure metadata, indexer and ingest apps are accessable on ports 3001, 3004 and 3002 resp;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Verify a new granule is ingested successfully.
(deftest granule-ingest-test
  (testing "ingest of a new granule"
    (let [collection (util/collection-concept "PROV1" 5)
