update tests and fix controller fn to extract the controller brokerid
This commit is contained in:
parent
ea2992b83b
commit
98a039115b
2 changed files with 13 additions and 3 deletions
|
@ -13,6 +13,10 @@
|
|||
:data
|
||||
#(zk/data z (str "/brokers/ids/" %)))
|
||||
(zk/children z "/brokers/ids")))))
|
||||
|
||||
(defn- controller-broker-id
|
||||
[^String zk-data]
|
||||
(get (read-str zk-data) "brokerid"))
|
||||
|
||||
(defn controller
|
||||
"Get leader node"
|
||||
|
@ -22,7 +26,7 @@
|
|||
(-> (zk/data z "/controller")
|
||||
:data
|
||||
String.
|
||||
Integer/valueOf)))
|
||||
controller-broker-id)))
|
||||
|
||||
(defn topics
|
||||
"Get topics"
|
||||
|
|
|
@ -10,8 +10,14 @@
|
|||
(def zk-connect {"zookeeper.connect" "127.0.0.1:2182"})
|
||||
(given (with-test-broker config
|
||||
(brokers zk-connect))
|
||||
(expect count 1
|
||||
first {:host "localhost", :jmx_port -1, :port 9999, :version 1}))
|
||||
(expect count 1))
|
||||
|
||||
(given (with-test-broker config
|
||||
(first (brokers zk-connect)))
|
||||
(expect :host "localhost"
|
||||
:jmx_port -1
|
||||
:port 9999
|
||||
:version 1))
|
||||
|
||||
(given (with-test-broker config
|
||||
(controller zk-connect))
|
||||
|
|
Loading…
Reference in a new issue