Clojure 中 mock/fake HTTP 请求的库不可知方式?
Library agnostic way to mock/fake http requests in Clojure?
我正在寻找一个类似于 mockwebserver in Clojure that allows you to programmatically define HTTP endpoints and their response by matching (parts of) the of the HTTP request (for testing purposes). I know that libraries such as clj-http-fake 的项目,但我正在寻找一种 library/framework 不可知的方式来定义端点。我自己创建了这样的东西,它允许我这样做:
(mws/given-mock-route! mock-web-server "/something" {:status 200 :content-type "application/json" :body (slurp (io/resource "responses/some.json"))})
但我想我读了一个博客或类似的东西,比如图书馆已经存在,但我似乎找不到它。
我正在寻找一个类似于 mockwebserver in Clojure that allows you to programmatically define HTTP endpoints and their response by matching (parts of) the of the HTTP request (for testing purposes). I know that libraries such as clj-http-fake 的项目,但我正在寻找一种 library/framework 不可知的方式来定义端点。我自己创建了这样的东西,它允许我这样做:
(mws/given-mock-route! mock-web-server "/something" {:status 200 :content-type "application/json" :body (slurp (io/resource "responses/some.json"))})
但我想我读了一个博客或类似的东西,比如图书馆已经存在,但我似乎找不到它。