Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException at the simple example #14

Open
itaied246 opened this issue Jan 11, 2018 · 1 comment
Open

IllegalArgumentException at the simple example #14

itaied246 opened this issue Jan 11, 2018 · 1 comment

Comments

@itaied246
Copy link

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?

@bguthrie
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants