Skip to content

Commit 384cbf9

Browse files
authored
Merge pull request #13 from OpenVoxProject/add_managed_deps
Add more managed deps for future updates, update cheshire
2 parents 6e1d572 + a78d881 commit 384cbf9

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

project.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
;; defined under :dependencies ends up causing an error due to :pedantic? :abort,
66
;; because it is a dep of a dep with a different version, move it here.
77
:managed-dependencies [[org.clojure/clojure "1.12.4"]
8+
[org.clojure/tools.logging "1.3.1"]
9+
[org.clojure/tools.macro "0.2.1"]
810
[ring/ring-codec "1.3.0"]
911
[commons-codec "1.20.0"]
10-
[org.slf4j/slf4j-api "2.0.17"]]
12+
[org.slf4j/slf4j-api "2.0.17"]
13+
[cheshire "5.13.0"]]
1114

12-
:dependencies [[cheshire "5.10.2"]
15+
:dependencies [[cheshire]
1316
[org.openvoxproject/http-client "2.2.1"]]
1417

1518
:min-lein-version "2.7.1"

test/puppetlabs/ring_middleware/core_test.clj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,11 @@
796796

797797
(deftest wrap-json-parse-exception-handler-test
798798
(let [factory (JsonFactory.)
799-
wrapped-handler (core/wrap-json-parse-exception-handler (fn [_] (throw (JsonParseException. (.createParser factory "") "Error Message" ))))
799+
wrapped-handler (core/wrap-json-parse-exception-handler (fn [_] (throw (JsonParseException. (.createParser factory "") "Error Message"))))
800800
response (wrapped-handler (basic-request))]
801-
(is (= {:body "{\"kind\":\"json-parse-exception\",\"msg\":\"Error Message\\n at [Source: (String)\\\"\\\"; line: 1, column: 1]\"}"
802-
:headers {"Content-Type" "application/json; charset=utf-8"}
803-
:status 400}
804-
response))))
801+
(is (= 400 (:status response)))
802+
(is (= {"Content-Type" "application/json; charset=utf-8"} (:headers response)))
803+
(let [body (json/parse-string (:body response))]
804+
(is (= "json-parse-exception" (get body "kind")))
805+
(is (clojure.string/starts-with? (get body "msg") "Error Message"))
806+
(is (clojure.string/includes? (get body "msg") "line: 1, column: 1")))))

0 commit comments

Comments
 (0)