 (deftest test-get-post-ok
   (let [[cl-sock srv-sock srv] (setup :connected)]
     (try
-      (let [response (server-client-comm cl-sock srv srv-sock msg/get-post "dummy-post-id")]
+      (let [post-id "dummy-post-id"
+            response (server-client-comm cl-sock srv srv-sock msg/get-post post-id)
+            expected (blank-msg)]
+        (server/get-single-post dummy-backend expected post-id)
         (is (= HydraMsg/GET_POST_OK
                (.id response)))
-        (is (= (server/get-single-post dummy-backend "dummy-post-id")
-               [(.post_id response)
-                (.reply_to response)
-                (.previous response)
-                (.tags response)
-                (.timestamp response)
-                (.type response)
-                (.content response)]))
+        (is (= post-id
+               (.post_id response)))
+        (is (= (.reply_to expected)
+               (.reply_to response)))
+        (is (= (.previous expected)
+               (.previous response)))
+        (is (= (.tags expected)
+               (.tags response)))
+        (is (= (.timestamp expected)
+               (.timestamp response)))
+        (is (= (.type expected)
+               (.type response)))
+        (is (= (.content expected)
+               (.content response)))
         (is (= :connected
                (-> @(:state srv) vals first))))
       (finally

(deftest test-get-tag-ok
  (let [[cl-sock srv-sock srv] (setup :connected)]
    (try
      (let [response (server-client-comm cl-sock srv srv-sock msg/get-tag "tag_1")]
        (is (= HydraMsg/GET_TAG_OK
               (.id response)))
        (is (= (server/get-single-tag dummy-backend "tag_1")
               [(.tag response) (.post_id response)]))
        (is (= :connected
               (-> @(:state srv) vals first))))
      (finally


(def dummy-backend
  (reify server/HydraServerBackend
    (get-latest-post [this m]
      (msg/post-id! m "dummy-post-id"))
    (get-single-post [this m post-id]
      (msg/reply-to! m "none")
      (msg/previous! m "none")
      (msg/tags! m "tag_2")
      (msg/timestamp! m 123123123)
      (msg/type! m "dummy")
      (msg/content! m "dummy-post"))
    (get-all-tags [this m]
      (msg/tags! m "tag_1 tag_2 tag_3 tag_4"))
    (get-single-tag [this m tag-id]
      (msg/post-id! m "dummy-post-id-2"))))

(defn setup [& [connect?]]
  (let [srv-sock (msg/server-socket test-endpoint)
