{"id":15439512,"url":"https://github.com/joelittlejohn/zookem","last_synced_at":"2025-04-19T18:42:32.842Z","repository":{"id":10963266,"uuid":"13277127","full_name":"joelittlejohn/zookem","owner":"joelittlejohn","description":"Clojure and Leiningen helper for running embedded Zookeeper instances for integration testing.","archived":false,"fork":false,"pushed_at":"2018-01-23T15:27:42.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T11:24:15.022Z","etag":null,"topics":["clojure","embedded","integration-testing","lein","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joelittlejohn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-02T17:04:57.000Z","updated_at":"2024-02-09T19:47:16.000Z","dependencies_parsed_at":"2022-09-23T06:20:55.285Z","dependency_job_id":null,"html_url":"https://github.com/joelittlejohn/zookem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fzookem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fzookem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fzookem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fzookem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joelittlejohn","download_url":"https://codeload.github.com/joelittlejohn/zookem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240404871,"owners_count":19796083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","embedded","integration-testing","lein","zookeeper"],"created_at":"2024-10-01T19:07:06.021Z","updated_at":"2025-03-02T21:31:11.399Z","avatar_url":"https://github.com/joelittlejohn.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zookem [![Build Status](https://travis-ci.org/joelittlejohn/zookem.png)](https://travis-ci.org/joelittlejohn/zookem)\n\nA helper for running embedded Zookeeper instances for integration testing. Based on [the curator-test TestingServer](http://curator.incubator.apache.org/curator-test/).\n\n## Usage\n\n#### As a test helper \n\nAn example in a `deftest`, just add `[zookem \"0.1.2\"]` to your project's dev dependencies then:\n\n```clj\n(ns (:require [zookem.core :as z))\n\n(deftest fn-that-uses-zookeeper-can-read-data-from-zookeeper\n  (z/with-zk {:port 2181 ;; optional, default is random\n              :nodes {\"/some/path/with/data\" \"data\"\n                      \"/some/path/without/data\" nil}}\n    (is (= 2181 z/*zk-port*))\n    (is (= \"127.0.0.1:2181\" z/*zk-connect-string*))\n    (is (= \u003csomevalue\u003e (fn-that-uses-zookeeper z/*zk-client*))))\n```\n\nThe _with-zk_ macro starts up an embedded instance of Zookeeper for testing, runs the body, then shuts down the Zookeeper instance. Inside the body of the macro, the dynamic vars _\\*zk-port\\*_, _\\*zk-connect-string\\*_ and _\\*zk-client\\*_ will be bound.\n\n#### As a lein plugin\n\n```clj\n(defproject myproject \"0.1.0\"\n  :plugins [[zookem \"0.1.2\"]]\n  :zookeeper {:port 2181\n              :nodes {\"/some/path/with/data\" \"data\"\n                      \"/some/path/without/data\" nil}})\n```\n\n    $ lein zookem test\n\nThe _zookem_ task starts an embedded instance of Zookeeper then runs the task given as an argument. Once the downstream task completes, the embedded instance of Zookeeper is terminated.\n\nThis library supports [environ](https://github.com/weavejester/environ) configuration, so you can also set the Zookeeper port using the 'env' key in your project.clj:\n\n```clj\n(defproject myproject \"0.1.0\"\n  :env {:zookeeper-port \"2181\"})\n```\n\nor as an environment variable:\n\n```\nZOOKEEPER_PORT=2181\n```\n\nor as a system property:\n\n```\n-Dzookeeper.port=2181\n```\n\n## License\n\nCopyright © 2013 Joe Littlejohn\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelittlejohn%2Fzookem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelittlejohn%2Fzookem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelittlejohn%2Fzookem/lists"}