@DisplayName("test_getProperties") @Test void testGetProperties() { RedisProperties redisProperties = environment.getProperties(RedisProperties.class); assertEquals(20, redisProperties.getMaxConnNum()); assertEquals("standalone", redisProperties.getMode()); assertTrue(redisProperties.isEnabled()); assertEquals(10000L, redisProperties.getTimeBetweenEvictionRunsMillis()); assertEquals(100, redisProperties.getProp1()); assertEquals(1.1, redisProperties.getProp3()); assertEquals(1, redisProperties.getProp4()); assertTrue(redisProperties.getJedisPoolConfig().isTestWhileIdle()); }
@Override public <T extends Properties> T getProperties(Class<T> clazz) { if (configMap.containsKey(clazz.getName())) { return (T) configMap.get(clazz.getName()); } lazyInitialize(clazz); return (T) configMap.getOrDefault(clazz.getName(), EMPTY); }
PropertiesEnvironment implements Environment { @Override public <T extends Properties> T getProperties(Class<T> clazz) { if (configMap.containsKey(clazz.getName())) { return (T) configMap.get(clazz.getName()); } lazyInitialize(clazz); return (T) configMap.getOrDefault(clazz.getName(), EMPTY); } }
PropertiesEnvironment implements Environment { @Override public <T extends Properties> T getProperties(Class<T> clazz) { if (configMap.containsKey(clazz.getName())) { return (T) configMap.get(clazz.getName()); } lazyInitialize(clazz); return (T) configMap.getOrDefault(clazz.getName(), EMPTY); } PropertiesEnvironment(); }
PropertiesEnvironment implements Environment { @Override public <T extends Properties> T getProperties(Class<T> clazz) { if (configMap.containsKey(clazz.getName())) { return (T) configMap.get(clazz.getName()); } lazyInitialize(clazz); return (T) configMap.getOrDefault(clazz.getName(), EMPTY); } PropertiesEnvironment(); @Override void scanAllProperties(); @Override void load(String configFileName); @Override T getProperties(Class<T> clazz); }
PropertiesEnvironment implements Environment { @Override public <T extends Properties> T getProperties(Class<T> clazz) { if (configMap.containsKey(clazz.getName())) { return (T) configMap.get(clazz.getName()); } lazyInitialize(clazz); return (T) configMap.getOrDefault(clazz.getName(), EMPTY); } PropertiesEnvironment(); @Override void scanAllProperties(); @Override void load(String configFileName); @Override T getProperties(Class<T> clazz);  }