   [f]
   (let [server (http/start-server handler {:port http-server-port})]
     (with-redefs [http-server server]
-      (try (f)
-           (finally (.close http-server))))))
+      (try (f) (finally (.close http-server))))))
 
 (defn ^:private store-reqs-fixture
   "A fixture that resets the request store."

             request)))))

(deftest invalid-http-step-tests
  (are [step expected] (= {:error expected} (get-body @(create-cap step)))
    {:type :http} '{:url missing-required-key
                    :method missing-required-key}))

  (with-redefs [recvd-reqs (atom [])]
    (f)))

(use-fixtures :once e2e/icecap-fixture http-server-fixture)
(use-fixtures :each store-reqs-fixture)

(deftest http-tests
  (let [plan {:type :http
              :method :GET
              :url (str http-server-base-url "/test/example")}
        create-result @(e2e/create-cap plan)
        cap-url (:cap (spy (e2e/get-body create-result)))
        exercise-result @(e2e/execute-cap cap-url)]
    ;; Was the cap successfully created?
    (is (= (:status create-result) 201))
    (is (some? cap-url))
