diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderTest.java index 070a07a4747..a424fdd1bf0 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderTest.java @@ -92,6 +92,24 @@ public void testMultiplePropertySourcesWithSameProperties() throws Exception { check("spring/XmlConfigPlaceholderTest3.xml", someTimeout, someBatch); } + @Test + public void testMultiplePropertySourcesWithSameProperties2() throws Exception { + int someTimeout = 1000; + int anotherTimeout = someTimeout + 1; + int someBatch = 2000; + + Config application = mock(Config.class); + when(application.getProperty(eq(TIMEOUT_PROPERTY), anyString())).thenReturn(String.valueOf(someTimeout)); + when(application.getProperty(eq(BATCH_PROPERTY), anyString())).thenReturn(String.valueOf(someBatch)); + mockConfig(ConfigConsts.NAMESPACE_APPLICATION, application); + + Config fxApollo = mock(Config.class); + when(fxApollo.getProperty(eq(TIMEOUT_PROPERTY), anyString())).thenReturn(String.valueOf(anotherTimeout)); + mockConfig(FX_APOLLO_NAMESPACE, fxApollo); + + check("spring/XmlConfigPlaceholderTest6.xml", anotherTimeout, someBatch); + } + @Test public void testMultiplePropertySourcesWithSamePropertiesWithWeight() throws Exception { int someTimeout = 1000; diff --git a/apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest6.xml b/apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest6.xml new file mode 100644 index 00000000000..befc2137a81 --- /dev/null +++ b/apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest6.xml @@ -0,0 +1,13 @@ + + + + + + + + +