Skip to content

IllegalArgumentException at the simple example #14

@itaied246

Description

@itaied246

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions