Skip to content

Commit

Permalink
get-category-test
Browse files Browse the repository at this point in the history
  • Loading branch information
saidone75 committed Jul 14, 2024
1 parent 94ed97d commit 727ebfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cral/api/core/categories.clj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"Get a specific category with `category-id`.\\
More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API)."
([^Ticket ticket ^String category-id]
(get-gategory ticket category-id nil))
(get-category ticket category-id nil))
([^Ticket ticket ^String category-id ^GetCategoryQueryParams query-params & [^PersistentHashMap opts]]
(utils/call-rest
client/get
Expand Down
9 changes: 9 additions & 0 deletions test/cral/categories_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@
;; clean up
(is (= (:status (nodes/delete-node ticket created-node-id {:permanent true})) 204))))

(deftest get-category-test
(let [ticket (get-in (auth/create-ticket c/user c/password) [:body :entry])
rand-category-id (-> (categories/list-categories ticket "-root-")
(get-in [:body :list :entries])
(rand-nth)
(get-in [:entry :id]))
get-category-response (categories/get-category ticket rand-category-id)]
(is (= (:status get-category-response) 200))))

(deftest delete-category-test
(let [ticket (get-in (auth/create-ticket c/user c/password) [:body :entry])
;; create category
Expand Down

0 comments on commit 727ebfa

Please sign in to comment.