   (testing (str "request to Jetty fails with a 413 error if the request header "
                 "is too large and a larger one is not set")
     (with-app-with-config app
-      [jetty9-service]
+      [jetty9-service
+       hello-webservice]
       jetty-plaintext-config
-      (let [s                   (tk-app/get-service app :WebserverService)
-            add-ring-handler    (partial add-ring-handler s)
-            body                "Hi World"
-            path                "/hi_world"
-            ring-handler        (fn [req] {:status 200 :body body})]
-        (add-ring-handler ring-handler path)
-        (let [response (http-get "http://localhost:8080/hi_world" {:headers {"Cookie" absurdly-large-cookie}
-                                                                   :as      :text})]
-          (is (= (:status response) 413))))))
+      (let [response (http-get "http://localhost:8080/hi_world" {:headers {"Cookie" absurdly-large-cookie}
+                                                                 :as :text})]
+        (is (= (:status response) 413)))))
 
   (testing (str "request to Jetty succeeds with a large cookie if the request header "
                 "size is properly set")

  (testing "request logging occurs when :access-log-config is configured"
    (with-app-with-config
      app
      [jetty9-service]
      {:webserver {:port 8080
                   :access-log-config
                         "./dev-resources/puppetlabs/trapperkeeper/services/webserver/request-logging.xml"}}
      (let [s (tk-app/get-service app :WebserverService)
            add-ring-handler (partial add-ring-handler s)
            ring-handler (fn [req] {:status 200 :body "Hello, World!"})]
        (add-ring-handler ring-handler "/hello")
        (http-get "http://localhost:8080/hello/")
        ; Logging is done in a separate thread from Jetty and this test. As a result,
        ; we have to sleep the thread to avoid a race condition.
        (Thread/sleep 10)
        (let [list (TestListAppender/list)]
          (is (re-find #"\"GET /hello/ HTTP/1.1\" 200 13\n" (first list))))))))

(deftest graceful-shutdown-test
  (testing "jetty9 webservers shut down gracefully by default"

  (testing "SSLv3 is not supported by default"
    (with-app-with-config
      app
      [jetty9-service
       hello-webservice]
      jetty-ssl-pem-config
      (is (thrown?
           ConnectionClosedException
           (http-get "https://localhost:8081/hi_world" (merge default-options-for-https-client
                                                              {:ssl-protocols ["SSLv3"]}))))))
  (testing "SSLv3 is supported when configured"
    (with-test-logging
     (with-app-with-config
      app
      [jetty9-service
       hello-webservice]
      (assoc-in jetty-ssl-pem-config [:webserver :ssl-protocols] ["SSLv3"])
       (let [response (http-get "https://localhost:8081/hi_world" (merge default-options-for-https-client
                                                                         {:ssl-protocols ["SSLv3"]}))]
         (is (= (:status response) 200))
         (is (= (:body response) "Hi World")))))))
