     (let [N 4
           expected-revision-id (- N 1)
           last-revision-id (last (repeatedly N
-                                             #(let [ {:keys [revision-id]} (save-concept (concept @provider-suffix-num-atom))]
+                                             #(let [ {:keys [revision-id]} (ingest-concept "put" (concept @provider-suffix-num-atom))]
                                                 revision-id)))]
       (is (= expected-revision-id last-revision-id)))
     (catch Exception e

                    :throw-exceptions true})
        status (:status response)
        body (cheshire/parse-string (:body response))
        revision-id (get body "revision-id")
        error-messages (get body "errors")]
    {:status status :revision-id revision-id :error-messages error-messages :response response}))

(def provider-suffix-num-atom (atom (rand-int 1000000)))


      (.printStackTrace e)
      (is false))))

;; ingest a concept first and delete the very same concept.
(deftest delete-concept-test
  "Verify concept is deleted from mdb and index."
  (swap! provider-suffix-num-atom inc)
  (try
    (let [{:keys [status revision-id]} (ingest-concept "put" (concept @provider-suffix-num-atom))
          saved? (and (= status 200) (= revision-id 0))]
      (if saved?
        (let [{:keys [status]} (ingest-concept "delete" (concept @provider-suffix-num-atom))]
          (is (= status 200)))
        (is false)))
    (catch Exception e
      (error "Exception occurred while executing concept-ingest-test: " (.getMessage e))
      (.printStackTrace e)
      (is false))))



