Skip to content

Commit

Permalink
Merge pull request #132 from saidone75/dev
Browse files Browse the repository at this point in the history
use -root- instead of search
  • Loading branch information
saidone75 authored Mar 30, 2024
2 parents f46c7b5 + a16ead2 commit 2ac2fae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/cral/nodes_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
[cral.alfresco.auth :as auth]
[cral.alfresco.core.nodes :as nodes]
[cral.alfresco.model.core :as model]
[cral.alfresco.model.search :as search-model]
[cral.alfresco.search :as search]
[cral.core :refer :all]
[cral.test-utils :as tu]
[taoensso.timbre :as timbre])
Expand All @@ -21,7 +19,7 @@
(deftest get-node
(let [ticket (get-in (auth/create-ticket user password) [:body :entry])
guest-home-id (:id (tu/get-guest-home ticket))]
;; well known fields for query parameters defined in core/QueryParamsGetNode
;; well known fields for query parameters defined in GetNodeQueryParams
(is (every? true? (map (partial contains? (get-in (nodes/get-node ticket guest-home-id (model/map->GetNodeQueryParams {:include ["path" "permissions"]})) [:body :entry])) [:path :permissions])))
;; but plain maps can be used as well
(is (every? true? (map (partial contains? (get-in (nodes/get-node ticket guest-home-id {:include ["path" "permissions"]}) [:body :entry])) [:path :permissions])))))
Expand All @@ -42,7 +40,7 @@

(deftest list-node-children
(let [ticket (get-in (auth/create-ticket user password) [:body :entry])
company-home-id (get-in (first (get-in (search/search ticket (search-model/map->SearchBody {:query (search-model/map->RequestQuery {:query "PATH:'app:company_home'"})})) [:body :list :entries])) [:entry :id])
company-home-id (get-in (nodes/get-node ticket "-root-") [:body :entry :id])
list-node-children-response (nodes/list-node-children ticket company-home-id)]
(is (= 200 (:status list-node-children-response)))
(is (not (nil? (some #(= "Data Dictionary" (:name %)) (map :entry (get-in list-node-children-response [:body :list :entries]))))))
Expand Down
1 change: 1 addition & 0 deletions test/cral/shared_links_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
create-node-response (nodes/create-node ticket parent-id create-node-body)]
(is (= (:status create-node-response) 201))
(let [create-shared-link-body (model/map->CreateSharedLinkBody {:node-id (get-in create-node-response [:body :entry :id])})
;; create a shared link
create-shared-link-response (shared-links/create-shared-link ticket create-shared-link-body)]
(= (:status create-shared-link-response) 200))
;; clean up
Expand Down

0 comments on commit 2ac2fae

Please sign in to comment.