Skip to content

tests: revert change for missing bb exceptions #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions test/clj_http/lite/integration_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@
(try
(request {:request-method :get :uri "/timeout" :socket-timeout 1})
(is false "expected a throw")
(catch Exception ^Exception e
(is (or (= "Read timed out" (.getMessage e))
(let [^Exception cause (.getCause e)]
(= "Read timed out" (.getMessage cause))))))))
(catch Exception e
(is (or (= java.net.SocketTimeoutException (class e))
(= java.net.SocketTimeoutException (class (.getCause e))))))))

(deftest delete-with-body
(let [resp (request {:request-method :delete :uri "/delete-with-body"
Expand All @@ -110,19 +109,13 @@
:scheme :https
:server-name "localhost"
:server-port (:https-port *server*)}]
(try
(request client-opts)
(is false "expected a throw")
(catch Exception ^Exception e
(is (re-find #"SunCertPathBuilderException" (.getMessage e)))))
(is (thrown? javax.net.ssl.SSLException
(request client-opts)))
(let [resp (request (assoc client-opts :insecure? true))]
(is (= 200 (:status resp)))
(is (= "get" (slurp-body resp))))
(try
(request client-opts)
(is false "expected a throw")
(catch Exception ^Exception e
(is (re-find #"SunCertPathBuilderException" (.getMessage e)))))))
(is (thrown? javax.net.ssl.SSLException
(request client-opts)))))

(deftest t-save-request-obj
(let [resp (request {:request-method :post :uri "/post"
Expand Down