Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
macielti committed Aug 23, 2023
1 parent dc330d3 commit 3db1c7d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/integration/integration/postgresql.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[common-clj.component.config :as component.config]
[common-clj.component.helper.core :as component.helper]
[common-clj.component.postgres-jdbc :as component.postgres-jdbc]
[matcher-combinators.test :refer [match?]]
[next.jdbc :as jdbc]
[clojure.instant :as instant]
[schema.test :as s]))
Expand All @@ -17,9 +18,9 @@
(let [system (component/start system-test)
postgresql (component.helper/get-component-content :postgresql system)]
(jdbc/execute! postgresql ["INSERT INTO pessoa (apelido, nome, nascimento) VALUES (?, ?, ?)" "brunão" "nascimento" (instant/read-instant-timestamp "2020-03-23T01:17Z")])
(is (= [{:apelido "brunão"
:nascimento #inst "2020-03-22T03:00:00.000-00:00"
:nome "nascimento"}]
(jdbc/execute! postgresql ["SELECT apelido, nascimento, nome FROM pessoa WHERE nome = ?" "nascimento"])))
(is (match? [{:apelido "brunão"
:nascimento inst?
:nome "nascimento"}]
(jdbc/execute! postgresql ["SELECT apelido, nascimento, nome FROM pessoa WHERE nome = ?" "nascimento"])))
(jdbc/execute! postgresql ["DROP TABLE pessoa"])
(component/stop system)))

0 comments on commit 3db1c7d

Please sign in to comment.