From 8624fd7d39c65b2e936794c38f7dfce014564005 Mon Sep 17 00:00:00 2001 From: Michiel de Mare Date: Mon, 3 Jun 2024 10:05:26 +0200 Subject: [PATCH] Test jobqueue --- test/nl/surf/eduhub_rio_mapper/endpoints/api_test.clj | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/nl/surf/eduhub_rio_mapper/endpoints/api_test.clj b/test/nl/surf/eduhub_rio_mapper/endpoints/api_test.clj index 32086d85..5b221cef 100644 --- a/test/nl/surf/eduhub_rio_mapper/endpoints/api_test.clj +++ b/test/nl/surf/eduhub_rio_mapper/endpoints/api_test.clj @@ -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 @@ -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)))))