CloudJobDisableListener implements CuratorCacheListener { public void stop() { getCache().listenable().removeListener(this); } CloudJobDisableListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager); @Override void event(final Type type, final ChildData oldData, final ChildData data); void start(); void stop();  }
@Test public void assertStop() { regCenter.addCacheData("/state/disable/job"); ReflectionUtils.setFieldValue(cloudJobDisableListener, "regCenter", regCenter); cloudJobDisableListener.stop(); }