                  (servlet-response response))
     (is (= (@response :status) 200))
     (is (= (get-in @response [:headers "Content-Type" ]) "text/plain"))
-    (is (= (take-while (complement zero?) (@response :body))
-           (seq (.getBytes "Hello World"))))))
+    (is (= (.toString (@response :body)) "Hello World"))))

        (is (= (@response :status) 200))
        (is (= (@response :content-type) "text/plain"))
        (is (= (get-in @response [:headers "X-Server"]) "Bar"))
        (is (= (take-while (complement zero?) (@response :body))
               (seq (.getBytes "Hello World"))))))))

(deftest servlet-cps-test
  (let [handler  (fn [_ respond _]

      (startAsync [] (async-context (request :completed))))))

(defn- servlet-response [response]
  (let [output-stream (java.io.ByteArrayOutputStream.)]
    (swap! response assoc :body output-stream)
    (proxy [javax.servlet.http.HttpServletResponse] []
      (getOutputStream []
        (proxy [javax.servlet.ServletOutputStream] []
          (write
            ([b] (.write output-stream b))
            ([b off len] (.write output-stream b off len)))))
      (setStatus [status]
        (swap! response assoc :status status))
      (setHeader [name value]
        (swap! response assoc-in [:headers name] value))
      (setCharacterEncoding [value])
      (setContentType [value]
        (swap! response assoc :content-type value)))))

(defn- servlet-config []
  (proxy [javax.servlet.ServletConfig] []
