Skip to content

Commit

Permalink
Fixed namespace of rio keyword. (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemare authored May 17, 2024
1 parent b8a50c3 commit 43cc2e0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/nl/surf/eduhub_rio_mapper/endpoints/status.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/nl/surf/eduhub_rio_mapper/rio/loader.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 12 additions & 11 deletions test/nl/surf/eduhub_rio_mapper/e2e_helper.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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?
Expand All @@ -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))))
Expand All @@ -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
Expand Down

0 comments on commit 43cc2e0

Please sign in to comment.