ConfigurableEnvironment c = (ConfigurableEnvironment) environment;
MutablePropertySources m = c.getPropertySources();
Properties p = new Properties();
p.put("spring.test.redis.host", "192.168.1.100");
p.put("spring.test.redis.password", "password");
p.put("spring.test.redis.port", "6379");
m.addFirst(new PropertiesPropertySource("defaultProperties", p));//defaultProperties是默认的属性命名空间