shrubbery
shrubbery copied to clipboard
IllegalArgumentException at the simple example
I'm trying to use this library, but I get the following error:
java.lang.IllegalArgumentException: db-spec xchange.data.user_test$eval27076$reify__27077@6ea22666 is missing a required parameter
at clojure.java.jdbc$get_connection.invokeStatic (jdbc.clj:379)
clojure.java.jdbc$get_connection.invoke (jdbc.clj:226)
clojure.java.jdbc$insert_rows_BANG_.invokeStatic (jdbc.clj:1301)
...
(:require [my.utils.db :refer [insert]])
(defn create-user
[conn user]
(insert conn :users user))
(defprotocol DbQueryClient
(insert [conn table user]))
(def db-stub
(stub DbQueryClient
{:insert :ok}))
(deftest user
(testing "stub"
(is (= :ok (create-user db-stub {:name "itaied"})))))
Am I missing something?
The example you gave looks right to me. Is there any chance you can reproduce the error in isolation, so I have a working example I can debug? Clearly it's still attempting to make a database connection somewhere.