Skip to content

Commit 862b112

Browse files
authored
tests: revert change for missing bb exceptions (#67)
Babashka now includes formerly missing exceptions
1 parent da57aa9 commit 862b112

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

test/clj_http/lite/integration_test.clj

+7-14
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@
9393
(try
9494
(request {:request-method :get :uri "/timeout" :socket-timeout 1})
9595
(is false "expected a throw")
96-
(catch Exception ^Exception e
97-
(is (or (= "Read timed out" (.getMessage e))
98-
(let [^Exception cause (.getCause e)]
99-
(= "Read timed out" (.getMessage cause))))))))
96+
(catch Exception e
97+
(is (or (= java.net.SocketTimeoutException (class e))
98+
(= java.net.SocketTimeoutException (class (.getCause e))))))))
10099

101100
(deftest delete-with-body
102101
(let [resp (request {:request-method :delete :uri "/delete-with-body"
@@ -110,19 +109,13 @@
110109
:scheme :https
111110
:server-name "localhost"
112111
:server-port (:https-port *server*)}]
113-
(try
114-
(request client-opts)
115-
(is false "expected a throw")
116-
(catch Exception ^Exception e
117-
(is (re-find #"SunCertPathBuilderException" (.getMessage e)))))
112+
(is (thrown? javax.net.ssl.SSLException
113+
(request client-opts)))
118114
(let [resp (request (assoc client-opts :insecure? true))]
119115
(is (= 200 (:status resp)))
120116
(is (= "get" (slurp-body resp))))
121-
(try
122-
(request client-opts)
123-
(is false "expected a throw")
124-
(catch Exception ^Exception e
125-
(is (re-find #"SunCertPathBuilderException" (.getMessage e)))))))
117+
(is (thrown? javax.net.ssl.SSLException
118+
(request client-opts)))))
126119

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

0 commit comments

Comments
 (0)