Skip to content

Commit

Permalink
Test jobqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemare committed Jun 3, 2024
1 parent 5fd64c1 commit 8624fd7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/nl/surf/eduhub_rio_mapper/endpoints/api_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
:institution-oin "123"))

(def config nil)
(def api-routes (api/routes {:enqueuer-fn (constantly nil)
(def last-job (atom nil))
(def api-routes (api/routes {:enqueuer-fn (fn [job] (reset! last-job job) nil)
:status-getter-fn (constantly {:test :dummy})}))

(deftest uuid-validation
Expand Down Expand Up @@ -334,3 +335,9 @@
(app {:token "test-error"})))

(status/purge! config)))

(deftest jobqueue
(let [req (authenticated-request :post "/job/upsert/education-specifications/12345678-1234-2345-3456-123456789abc")
req (assoc-in req [:headers "x-callback"] "https://google.com/")]
(is (= http-status/ok (:status (api-routes req))))
(is (= "https://google.com/" (::job/callback-url @last-job)))))

0 comments on commit 8624fd7

Please sign in to comment.