Skip to content

Commit

Permalink
CMR-10140-1: fixing database integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
eereiter committed Oct 31, 2024
1 parent b5be135 commit 3b0ec17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
{concept-id2 :concept-id revision-id2 :revision-id} (util/save-concept concept2)
{:keys [status revision-id] :as tombstone} (util/delete-concept concept-id)
deleted-concept1 (:concept (util/get-concept-by-id-and-revision concept-id revision-id))
saved-concept1 (:concept (util/get-concept-by-id-and-revision concept-id (dec revision-id)))]
saved-concept1 (:concept (util/get-concept-by-id-and-revision concept-id (dec revision-id)))
metadata (if (= :subscription concept-type)
(:metadata saved-concept1)
"")]
(is (= {:status 201 :revision-id 4}
{:status status :revision-id revision-id}))

(is (= (dissoc (assoc saved-concept1
:deleted true
:metadata ""
:revision-id revision-id
:metadata metadata
:user-id nil)
:revision-date :user-id :transaction-id)
(dissoc deleted-concept1 :revision-date :user-id :transaction-id)))
Expand Down Expand Up @@ -88,7 +91,7 @@
(is (= {:status 201
:revision-id 4
:deleted true
:metadata ""}
:metadata (:metadata stored-concept1)}
{:status status
:revision-id revision-id
:deleted (:deleted stored-concept1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
(let [{:keys [subscription_concept_id last_notified_at aws_arn]} data]
(j/with-db-transaction [conn db]
{:subscription-concept-id subscription_concept_id
:last-notified-at (oracle/oracle-timestamp->str-time conn last_notified_at)
:last-notified-at (when last_notified_at
(oracle/oracle-timestamp->str-time conn last_notified_at))
:aws-arn aws_arn})))

(defn subscription-exists?
Expand Down

0 comments on commit 3b0ec17

Please sign in to comment.