embedded zookeeper for unit/integration test

后端 未结 4 988
我寻月下人不归
我寻月下人不归 2021-02-07 10:56

Is there an embedded zookeeper so that we could use it in unit testing? It can be shipped with the test and run out of the box. Maybe we could mock some service and register to

4条回答
  •  遥遥无期
    2021-02-07 11:29

    The Curator framework has TestingServer and TestingCluster classes (see https://github.com/Netflix/curator/wiki/Utilities) that are in a separate maven artifact (curator-test - see the Maven/Artifacts section of https://github.com/Netflix/curator/wiki).

    They're pretty self explanatory, or you can download the curator code base and see how they're used internally in their own test cases.

    We've used both successfully within unit tests at $DAY_JOB.

提交回复
热议问题