               :steps   [{:stepId    "1"
                          :state     :running
                          :name      "run"
-                         :startTime "2016-01-01T12:00:00.000Z"
+                         :startTime joda-date-12-str
                          :endTime   nil
                          :type      :container
                          :steps     [{:stepId    "1-1"
                                       :state     :running
-                                      :type :step
-                                      :steps []
-                                      :name      "do-stuff"
-                                      :startTime "2016-01-01T12:00:00.000Z"
+                                      :type      :step
+                                      :steps     []
+                                      :name      "do-stuff"
+                                      :startTime joda-date-12-str
                                       :endTime   nil}
 
                                      {:stepId    "2-1"
                                       :state     :pending
                                       :name      "do-stuff"
-                                      :type :step
-                                      :steps []
+                                      :type      :step
+                                      :steps     []
                                       :startTime nil
                                       :endTime   nil}]}]} (subject/build-details-from-pipeline pipeline-with-substeps pipeline-with-substeps-state buildId nil)))))
 

    (let [

          event-channel (async/chan)
          sent-channel  (async/chan 1)
          closed (atom false)
          ws-ch         (reify httpkit-server/Channel
                          (on-close [& _])
                          (close [ws-ch] (reset! closed true))
                          (send! [ws-ch data] (async/>!! sent-channel data)))]
      (with-redefs [event-bus/subscribe (fn [ctx topic] nil)
                    event-bus/only-payload (fn [subscription] event-channel)
                    state/get-all (fn [_] {})]

                         :state     :running
                         :name      "in-parallel"
                         :type      :parallel
                         :startTime joda-date-12-str
                         :endTime   nil
                         :steps     [{:stepId    "1-1"
                                      :state     :running
                                      :type      :step
                                      :steps     []
                                      :name      "do-stuff"
                                      :startTime joda-date-12-str
                                      :endTime   nil}

                                     {:stepId    "2-1"
                                      :state     :pending
                                      :name      "do-stuff"
                                      :type      :step
                                      :steps     []
                                      :startTime nil
                                      :endTime   nil}]}]} (subject/build-details-from-pipeline pipeline-with-substeps-parallel pipeline-with-substeps-state buildId nil))))))

(deftest output-websocket
  (testing "that a payload is sent through the ws channel"
    (let [event-channel (async/chan)
          sent-channel (async/chan 1)
          ws-ch (reify httpkit-server/Channel
                  (on-close [& _])
                  (send! [ws-ch data] (async/>!! sent-channel data)))]
      (with-redefs [event-bus/subscribe (fn [ctx topic] nil)
                    event-bus/only-payload (fn [subscription] event-channel)
                    state/get-all (fn [_] {})]
