* author: Simon Woodman swoodman@redhat.com */ -public class ZooKeeperConfigSource implements ConfigSource { +public class ZooKeeperConfigSource extends AbstractConfigSource { + private static final long serialVersionUID = 3127679154588598693L; private static final Logger logger = Logger.getLogger(ZooKeeperConfigSource.class.getName()); @@ -44,11 +46,7 @@ public class ZooKeeperConfigSource implements ConfigSource { private static final String ZOOKEEPER_CONFIG_SOURCE_NAME = "io.smallrye.configsource.zookeeper"; public ZooKeeperConfigSource() { - } - - @Override - public int getOrdinal() { - return 150; + super(ZOOKEEPER_CONFIG_SOURCE_NAME, 150); } @Override @@ -108,11 +106,6 @@ public String getValue(final String key) { return null; } - @Override - public String getName() { - return ZOOKEEPER_CONFIG_SOURCE_NAME; - } - private CuratorFramework getCuratorClient() throws ZooKeeperConfigException { CuratorFramework cachedClient = curatorReference.get(); diff --git a/sources/zookeeper/src/test/java/io/smallrye/configsource/zookeeper/tests/ZooKeeperConfigSourceTest.java b/sources/zookeeper/src/test/java/io/smallrye/configsource/zookeeper/tests/ZooKeeperConfigSourceTest.java index 71fd02c60..2b09126b7 100644 --- a/sources/zookeeper/src/test/java/io/smallrye/configsource/zookeeper/tests/ZooKeeperConfigSourceTest.java +++ b/sources/zookeeper/src/test/java/io/smallrye/configsource/zookeeper/tests/ZooKeeperConfigSourceTest.java @@ -33,6 +33,7 @@ import org.junit.Test; import org.junit.runner.RunWith; +import io.smallrye.config.AbstractConfigSource; import io.smallrye.configsource.ZooKeeperConfigSource; /** @@ -76,6 +77,7 @@ public static WebArchive createDeployment() { return ShrinkWrap.create(WebArchive.class, "ZkMicroProfileConfigTest.war") .addPackage(ZooKeeperConfigSource.class.getPackage()) + .addPackage(AbstractConfigSource.class.getPackage()) .addAsLibraries(curatorFiles) .addAsLibraries(swarmMPCFiles) .addAsLibraries(curatorTestFiles)