File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
test/puppetlabs/ring_middleware Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 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" )))))
You can’t perform that action at this time.
0 commit comments