             (is (= 0 (times-called publish)))
             (is (= 1 (count (fs/list-dir discard-dir))))
             (is (= 0 (times-called process-counter)))))))))
-
-(defn append-attempts [n command]
-  (assoc-in command [:annotations :attempts] (repeat n {})))
 
 (deftest command-retry-handler
   (testing "Should log retries as debug for less than 4 attempts"

  [command publish-var discard-var & body]
  `(test-msg-handler* ~command ~publish-var ~discard-var *db* ~@body))

(deftest command-processor-integration
  (let [command {:command "some command" :version 1 :payload "\"payload\""}]
    (testing "correctly formed messages"

                        mh (mql/message-handler q nil
                                                delay-message process-message)]]
            (binding [*logger-factory* (atom-logger log-output)]
              (mh (-> (tqueue/store-command q "replace catalog" 10
                                            "cats" {:certname "cats"})
                      (add-fake-attempts i)))
              (is (called? delay-message))
              (is (not (called? mql/discard-message)))

