用于单元/集成测试的嵌入式动物园管理员 [英] embedded zookeeper for unit/integration test

查看:27
本文介绍了用于单元/集成测试的嵌入式动物园管理员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有嵌入式 zookeeper 以便我们可以在单元测试中使用它?它可以与测试一起发货并开箱即用.也许我们可以模拟一些服务并注册到嵌入式动物园管理员

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 the embedded zookeeper

推荐答案

Curator 框架具有TestingServer 和 TestingCluster 类(参见 https://github.com/Netflix/curator/wiki/Utilitiesa>) 位于单独的 Maven 工件中(curator-test - 请参阅 https://github.com/Netflix/curator/wiki 的 Maven/Artifacts 部分/github.com/Netflix/curator/wiki).

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.

我们在 $DAY_JOB 的单元测试中成功使用了这两种方法.

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

这篇关于用于单元/集成测试的嵌入式动物园管理员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆