ZebraSeataConfiguration extends AbstractConfiguration { @Override public String getConfig(String dataId, String defaultValue, long timeoutMills) { Object value = seataConfiguration.getOrDefault(dataId, defaultValue); return value == null ? null : String.valueOf(value); } ZebraSeataConfiguration(Properties seataConfiguration); @Override String getTypeName(); @Override String getConfig(String dataId, String defaultValue, long timeoutMills); @Override boolean putConfig(String dataId, String content, long timeoutMills); @Override boolean putConfigIfAbsent(String dataId, String content, long timeoutMills); @Override boolean removeConfig(String dataId, long timeoutMills); @Override void addConfigListener(String dataId, Object listener); @Override void removeConfigListener(String dataId, Object listener); @Override List getConfigListeners(String dataId);  }
@Test public void testGet() { Properties properties = new Properties(); properties.put("transport.heartbeat", true); properties.put("service.default.grouplist", "127.0.0.1:8091"); properties.put("transport.shutdown.wait", 3); ZebraSeataConfiguration zebraSeataConfiguration = new ZebraSeataConfiguration(properties); boolean transportHeartbeat = zebraSeataConfiguration.getBoolean("transport.heartbeat"); assertThat(transportHeartbeat, is(true)); String serviceDefaultGroupList = zebraSeataConfiguration.getConfig("service.default.grouplist"); assertThat(serviceDefaultGroupList, is("127.0.0.1:8091")); int transportShutdownWait = zebraSeataConfiguration.getInt("transport.shutdown.wait"); assertThat(transportShutdownWait, is(3)); String configOfDefaultValue = zebraSeataConfiguration.getConfig("hello.world", "ping.pong"); assertThat(configOfDefaultValue, is("ping.pong")); String notExistConf = zebraSeataConfiguration.getConfig("not.exist"); assertThat(notExistConf, is(nullValue())); }