Skip to content

Commit

Permalink
Rename langohr.http/declare-user to langohr.http/add-user
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Mar 6, 2014
1 parent 14e027f commit bd3e441
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/clojure/langohr/http.clj
Expand Up @@ -224,10 +224,15 @@
[^String vhost]
(get-and-decode-json (url-with-path (format "/api/vhosts/%s" (URLEncoder/encode vhost)))))

(defn declare-vhost
(defn add-vhost
[^String vhost]
(put (url-with-path (format "api/vhosts/%s" (URLEncoder/encode vhost))) {:body {:name vhost}}))

(defn ^{:deprecated true} declare-vhost
"Deprecated. Use add-vhost."
[^String vhost]
(add-vhost vhost))

(defn delete-vhost
[^String vhost]
(delete (url-with-path (format "/api/vhosts/%s" (URLEncoder/encode vhost)))))
Expand Down
2 changes: 1 addition & 1 deletion test/langohr/test/http_api_test.clj
Expand Up @@ -143,7 +143,7 @@
(deftest ^{:http true} test-vhost-manipulations
(let [vhost "new-vhost"]
(is (not (hc/vhost-exists? vhost)))
(hc/declare-vhost vhost)
(hc/add-vhost vhost)
(is (hc/vhost-exists? vhost))
(hc/delete-vhost vhost)))

Expand Down

0 comments on commit bd3e441

Please sign in to comment.