diff --git a/src/nl/surf/eduhub_rio_mapper/endpoints/status.clj b/src/nl/surf/eduhub_rio_mapper/endpoints/status.clj index 0294cb76..6d05c987 100644 --- a/src/nl/surf/eduhub_rio_mapper/endpoints/status.clj +++ b/src/nl/surf/eduhub_rio_mapper/endpoints/status.clj @@ -23,8 +23,8 @@ [nl.jomco.http-status-codes :as http-status] [nl.jomco.ring-trace-context :as trace-context] [nl.surf.eduhub-rio-mapper.job :as job] - [nl.surf.eduhub-rio-mapper.rio.helper :as rio-helper] [nl.surf.eduhub-rio-mapper.specs.ooapi :as ooapi] + [nl.surf.eduhub-rio-mapper.specs.rio :as rio] [nl.surf.eduhub-rio-mapper.utils.http-utils :as http-utils] [nl.surf.eduhub-rio-mapper.utils.logging :as logging] [nl.surf.eduhub-rio-mapper.utils.redis :as redis])) @@ -102,7 +102,7 @@ (fn [{::job/keys [callback-url] :keys [token action] ::ooapi/keys [id type] :as job} status & [data]] (let [opleidingseenheidcode (-> data :aanleveren_opleidingseenheid_response :opleidingseenheidcode) - aangeb-opleidingcode (-> data ::rio-helper/aangeboden-opleiding-code) + aangeb-opleidingcode (-> data ::rio/aangeboden-opleiding-code) value (cond-> {:status status :token token :action action diff --git a/src/nl/surf/eduhub_rio_mapper/rio/loader.clj b/src/nl/surf/eduhub_rio_mapper/rio/loader.clj index dfc2f360..fef8afbd 100644 --- a/src/nl/surf/eduhub_rio_mapper/rio/loader.clj +++ b/src/nl/surf/eduhub_rio_mapper/rio/loader.clj @@ -224,13 +224,13 @@ (fn getter [{::ooapi/keys [id] ::rio/keys [type opleidingscode aangeboden-opleiding-code] :keys [institution-oin pagina response-type] - :or {pagina 0}}] + :or {pagina 0} :as m}] {:pre [(or (aangeboden-opleiding-types type) - opleidingscode) + opleidingscode (throw (ex-info "first precondition" m))) (or (not= type aangeboden-opleidingen-van-organisatie-type) id) (or (not= type aangeboden-opleiding-type) - aangeboden-opleiding-code)]} + aangeboden-opleiding-code (throw (ex-info "third precondition" m)))]} (when-not (valid-get-types type) (throw (ex-info (str "Unexpected type: " type) {:id id diff --git a/test/nl/surf/eduhub_rio_mapper/e2e_helper.clj b/test/nl/surf/eduhub_rio_mapper/e2e_helper.clj index 51c277b1..024f00f8 100644 --- a/test/nl/surf/eduhub_rio_mapper/e2e_helper.clj +++ b/test/nl/surf/eduhub_rio_mapper/e2e_helper.clj @@ -28,9 +28,8 @@ [nl.surf.eduhub-rio-mapper.config :as config] [nl.surf.eduhub-rio-mapper.endpoints.status :as status] [nl.surf.eduhub-rio-mapper.remote-entities-helper :as remote-entities] - [nl.surf.eduhub-rio-mapper.rio.helper :as rio-helper] [nl.surf.eduhub-rio-mapper.rio.loader :as rio-loader] - [nl.surf.eduhub-rio-mapper.specs.ooapi :as ooapi] + [nl.surf.eduhub-rio-mapper.specs.rio :as rio] [nl.surf.eduhub-rio-mapper.utils.http-utils :as http-utils] [nl.surf.eduhub-rio-mapper.utils.xml-utils :as xml-utils]) (:import [java.net ConnectException] @@ -348,7 +347,9 @@ (defn job-result-aangebodenopleidingcode "Short cut to `post-job` job response attributes aangebodenopleidingcode." [job] - (job-result-attributes job :aangebodenopleidingcode)) + (or + (job-result-attributes job :aangebodenopleidingcode) + (throw (ex-info "error job-result-aangebodenopleidingcode" job)))) (defmethod test/assert-expr 'job-result-aangebodenopleidingcode [msg form] `(let [job# ~(second form) @@ -450,8 +451,8 @@ "Call RIO `opvragen_opleidingsrelatiesBijOpleidingseenheid`." [code] (print-boxed "rio-relations" - (rio-get {::rio-helper/type rio-loader/opleidingsrelaties-bij-opleidingseenheid-type - ::rio-helper/opleidingscode code + (rio-get {::rio/type rio-loader/opleidingsrelaties-bij-opleidingseenheid-type + ::rio/opleidingscode code :institution-oin (:institution-oin @client-info)}))) (defn rio-with-relation? @@ -476,8 +477,8 @@ "Call RIO `opvragen_opleidingseenheid`." [code] (print-boxed "rio-opleidingseenheid" - (-> {::rio-helper/type rio-loader/opleidingseenheid-type - ::rio-helper/opleidingscode code + (-> {::rio/type rio-loader/opleidingseenheid-type + ::rio/opleidingscode code :institution-oin (:institution-oin @client-info) :response-type :literal} (rio-get)))) @@ -486,10 +487,10 @@ "Call RIO `opvragen_aangebodenOpleiding`." [id] (print-boxed "rio-aangebodenopleiding" - (-> {::rio-helper/type rio-loader/aangeboden-opleiding-type - ::ooapi/id id - :institution-oin (:institution-oin @client-info) - :response-type :literal} + (-> {::rio/type rio-loader/aangeboden-opleiding-type + ::rio/aangeboden-opleiding-code id + :institution-oin (:institution-oin @client-info) + :response-type :literal} (rio-get)))) (defn get-in-xml