### Question:
DubboDefaultPropertiesEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { MutablePropertySources propertySources = environment.getPropertySources(); Map<String, Object> defaultProperties = createDefaultProperties(environment); if (!CollectionUtils.isEmpty(defaultProperties)) { addOrReplace(propertySources, defaultProperties); } }  @Override void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application); @Override int getOrder(); static final String PROPERTY_SOURCE_NAME; static final String ALLOW_BEAN_DEFINITION_OVERRIDING_PROPERTY; }### Answer:
@Test public void testPostProcessEnvironment() { MockEnvironment environment = new MockEnvironment(); instance.postProcessEnvironment(environment, springApplication); MutablePropertySources propertySources = environment.getPropertySources(); PropertySource defaultPropertySource = propertySources.get("defaultProperties"); Assert.assertNotNull(defaultPropertySource); Assert.assertEquals("true", defaultPropertySource.getProperty("dubbo.config.multiple")); Assert.assertEquals("false", defaultPropertySource.getProperty("dubbo.application.qos-enable")); environment.setProperty("spring.application.name", "demo-dubbo-application"); instance.postProcessEnvironment(environment, springApplication); defaultPropertySource = propertySources.get("defaultProperties"); Object dubboApplicationName = defaultPropertySource.getProperty("dubbo.application.name"); Assert.assertEquals("demo-dubbo-application", dubboApplicationName); environment = new MockEnvironment(); propertySources = environment.getPropertySources(); environment.setProperty("dubbo.application.name", "demo-dubbo-application"); instance.postProcessEnvironment(environment, springApplication); defaultPropertySource = propertySources.get("defaultProperties"); Assert.assertNotNull(defaultPropertySource); dubboApplicationName = environment.getProperty("dubbo.application.name"); Assert.assertEquals("demo-dubbo-application", dubboApplicationName); environment = new MockEnvironment(); propertySources = environment.getPropertySources(); propertySources.addLast(new MapPropertySource("defaultProperties", new HashMap<String, Object>())); environment.setProperty("spring.application.name", "demo-dubbo-application"); instance.postProcessEnvironment(environment, springApplication); defaultPropertySource = propertySources.get("defaultProperties"); dubboApplicationName = defaultPropertySource.getProperty("dubbo.application.name"); Assert.assertEquals("demo-dubbo-application", dubboApplicationName); environment = new MockEnvironment(); propertySources = environment.getPropertySources(); propertySources.addLast(new MapPropertySource("defaultProperties", new HashMap<String, Object>())); environment.setProperty("dubbo.config.multiple", "false"); environment.setProperty("dubbo.application.qos-enable", "true"); instance.postProcessEnvironment(environment, springApplication); Assert.assertEquals("false", environment.getProperty("dubbo.config.multiple")); Assert.assertEquals("true", environment.getProperty("dubbo.application.qos-enable")); }