 
       (assert (= (count bar-actions) 1))
       (assert (and (= (:library (first bar-actions)) "lib-4")
-               (= (:last-processed-version (first bar-actions))
-                  "6.0"))))))
+                   (= (:last-processed-version (first bar-actions))
+                      "6.0"))))))
 
 (deftest worker-integration-test
   (let [db (component/start (get-db))
         web-server (component/start (map->WebServer {:config config
-                                                     :db db}))]
+                                                     :db db}))
+        versions (atom {"lib-1" 1
+                        "lib-2" 2
+                        "lib-3" 3
+                        "lib-4" 4})]
     (timbre/set-level! :info)
     (try
-      (with-redefs [ver/latest-release (mock-latest-release-fn)]
+      (with-redefs [ver/latest-release (mock-latest-release-fn versions)]
         (create-actions)
-        (run-worker db)
+        (run-worker db versions)
         (assert-actions-updated))
       (finally
         (component/stop web-server)

            [hatnik.versions :as ver]
            [com.stuartsierra.component :as component]
            [hatnik.test-utils :refer :all :exclude [config]]
            [taoensso.timbre :as timbre]))

;;;
;;; Integration test that verifies that worker job is executed periodically.

                                        :utils utils})
                   component/start)]
    (try
      ; Wait for the first update by worker and update libraries.
      (acquire email-semaphore 2)
      (acquire gi-semaphore 1)
      (reset! versions {"lib-1" 3
                        "lib-2" 4
                        "lib-3" 5
                        "lib-4" 6})

      ; Wait for the second update by worker and verify send-email
      ; and create-github-issue mocks.
      (acquire email-semaphore 2)
      (acquire gi-semaphore 1)
      (assert-emails-args @email-args)
      (assert-github-issue-args @gi-args)

