mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 08:21:11 +00:00
Merge pull request #157 from valerauko/fix-tests-reflection
Fix tests and reflection warnings
This commit is contained in:
commit
a1aee49105
4 changed files with 8 additions and 10 deletions
|
|
@ -66,9 +66,9 @@
|
||||||
:headers {"Content-Type" "text/plain"}
|
:headers {"Content-Type" "text/plain"}
|
||||||
:body (str "Malformed " (-> e ex-data :format pr-str) " request.")})
|
:body (str "Malformed " (-> e ex-data :format pr-str) " request.")})
|
||||||
|
|
||||||
(defn wrap-log-to-console [handler e {:keys [uri request-method] :as req}]
|
(defn wrap-log-to-console [handler ^Throwable e {:keys [uri request-method] :as req}]
|
||||||
(print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e))
|
(print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e))
|
||||||
(.printStackTrace e *out*)
|
(.printStackTrace e ^PrintWriter *out*)
|
||||||
(handler e req))
|
(handler e req))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -86,9 +86,9 @@
|
||||||
:headers {"Content-Type" "text/plain"}
|
:headers {"Content-Type" "text/plain"}
|
||||||
:body (str "Malformed " (-> e ex-data :format pr-str) " request.")})
|
:body (str "Malformed " (-> e ex-data :format pr-str) " request.")})
|
||||||
|
|
||||||
(defn wrap-log-to-console [handler e {:keys [uri request-method] :as req}]
|
(defn wrap-log-to-console [handler ^Throwable e {:keys [uri request-method] :as req}]
|
||||||
(print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e))
|
(print! *out* (Instant/now) request-method (pr-str uri) "=>" (.getMessage e))
|
||||||
(.printStackTrace e *out*)
|
(.printStackTrace e ^PrintWriter *out*)
|
||||||
(handler e req))
|
(handler e req))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -99,9 +99,7 @@
|
||||||
:coercion reitit.coercion.spec/coercion}
|
:coercion reitit.coercion.spec/coercion}
|
||||||
:validate rrs/validate-spec!})))
|
:validate rrs/validate-spec!})))
|
||||||
|
|
||||||
(is (thrown-with-msg?
|
(is (r/router?
|
||||||
ExceptionInfo
|
|
||||||
#"Invalid route data"
|
|
||||||
(ring/router
|
(ring/router
|
||||||
["/api"
|
["/api"
|
||||||
["/plus/:e"
|
["/plus/:e"
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,9 @@
|
||||||
:header {:d string?}
|
:header {:d string?}
|
||||||
:path {:e string?}}}))
|
:path {:e string?}}}))
|
||||||
|
|
||||||
(is (not (s/valid?
|
(is (s/valid?
|
||||||
::rs/parameters
|
::rs/parameters
|
||||||
{:parameters {:header {"d" string?}}})))
|
{:parameters {:header {"d" string?}}}))
|
||||||
|
|
||||||
(is (s/valid?
|
(is (s/valid?
|
||||||
::rs/responses
|
::rs/responses
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue