Exception when attempting to run Cloverage with compojure auth middleware

95 views Asked by At

Cloverage is now failing after I adding role based authentication to my compojure api. Whilst running lein cloverage I get this exception:

Exception in thread "main" java.lang.IllegalArgumentException: No method in multimethod 'restructure-param' for dispatch value: :auth-roles, compiling:(/private/var/folders/w_/yt926bqs21g44f257yz05ctsjbv948/T/form-init3368607975292148784.clj:1:125)

Here is my auth middleware:

(defmethod compojure.api.meta/restructure-param :auth-roles
[_ required-roles acc]

(update-in acc [:middleware] conj [require-roles required-roles]))
1

There are 1 answers

0
Freid001 On BEST ANSWER

See github issue: https://github.com/cloverage/cloverage/issues/164#issuecomment-281673566

(defmethod compojure.api.meta/restructure-param :auth-roles
  [_ required-roles acc]

  (update-in acc [:middleware] conj [`require-roles required-roles]))