test_class.file: dubbo-config/dubbo-config-spring/src/test/java/com/alibaba/dubbo/config/spring/util/PropertySourcesUtilsTest.java
test_class.identifier: PropertySourcesUtilsTest
test_case.body: @Test
      public void testGetSubProperties() {
  
          MutablePropertySources propertySources = new MutablePropertySources();
  
          Map<String, Object> source = new HashMap<String, Object>();
          Map<String, Object> source2 = new HashMap<String, Object>();
  
          MapPropertySource propertySource = new MapPropertySource("propertySource", source);
          MapPropertySource propertySource2 = new MapPropertySource("propertySource2", source2);
  
          propertySources.addLast(propertySource);
          propertySources.addLast(propertySource2);
  
          Map<String, Object> result = PropertySourcesUtils.getSubProperties(propertySources, "user");
  
          Assert.assertEquals(Collections.emptyMap(), result);
  
          source.put("age", "31");
          source.put("user.name", "Mercy");
          source.put("user.age", "${age}");
  
          source2.put("user.name", "mercyblitz");
          source2.put("user.age", "32");
  
          Map<String, Object> expected = new HashMap<String, Object>();
          expected.put("name", "Mercy");
          expected.put("age", "31");
  
          result = PropertySourcesUtils.getSubProperties(propertySources, "user");
  
          Assert.assertEquals(expected, result);
  
          result = PropertySourcesUtils.getSubProperties(propertySources, "");
  
          Assert.assertEquals(Collections.emptyMap(), result);
  
          result = PropertySourcesUtils.getSubProperties(propertySources, "no-exists");
  
          Assert.assertEquals(Collections.emptyMap(), result);
  
      }
test_case.class_method_signature: PropertySourcesUtilsTest.testGetSubProperties()
test_case.full_signature: @Test public void testGetSubProperties()
test_case.identifier: testGetSubProperties
test_case.invocations: addLast addLast getSubProperties assertEquals emptyMap put put put put put put put getSubProperties assertEquals getSubProperties assertEquals emptyMap getSubProperties assertEquals emptyMap
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetSubProperties()
focal_class.file: dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/util/PropertySourcesUtils.java
focal_class.identifier: PropertySourcesUtils
focal_class.class_method_signature: PropertySourcesUtils.getSubProperties(Iterable<PropertySource<?>> propertySources, String prefix)
focal_class.full_signature: public static Map<String, Object> getSubProperties(Iterable<PropertySource<?>> propertySources, String prefix)
focal_class.identifier: getSubProperties
focal_class.modifiers: public static
focal_class.parameters: (Iterable<PropertySource<?>> propertySources, String prefix)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getSubProperties(Iterable<PropertySource<?>> propertySources, String prefix)
focal_class.class_method_signature: PropertySourcesUtils.getSubProperties(ConfigurableEnvironment environment, String prefix)
focal_class.full_signature: public static Map<String, Object> getSubProperties(ConfigurableEnvironment environment, String prefix)
focal_class.identifier: getSubProperties
focal_class.modifiers: public static
focal_class.parameters: (ConfigurableEnvironment environment, String prefix)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getSubProperties(ConfigurableEnvironment environment, String prefix)
focal_class.class_method_signature: PropertySourcesUtils.normalizePrefix(String prefix)
focal_class.full_signature: public static String normalizePrefix(String prefix)
focal_class.identifier: normalizePrefix
focal_class.modifiers: public static
focal_class.parameters: (String prefix)
focal_class.return: String
focal_class.signature: String normalizePrefix(String prefix)
focal_method.body: public static Map<String, Object> getSubProperties(Iterable<PropertySource<?>> propertySources, String prefix) {
  
          // Non-Extension AbstractEnvironment
          AbstractEnvironment environment = new AbstractEnvironment() {
          };
  
          MutablePropertySources mutablePropertySources = environment.getPropertySources();
  
          for (PropertySource<?> source : propertySources) {
              mutablePropertySources.addLast(source);
          }
  
          return getSubProperties(environment, prefix);
  
      }
focal_method.class_method_signature: PropertySourcesUtils.getSubProperties(Iterable<PropertySource<?>> propertySources, String prefix)
focal_method.full_signature: public static Map<String, Object> getSubProperties(Iterable<PropertySource<?>> propertySources, String prefix)
focal_method.identifier: getSubProperties
focal_method.invocations: getPropertySources addLast getSubProperties
focal_method.modifiers: public static
focal_method.parameters: (Iterable<PropertySource<?>> propertySources, String prefix)
focal_method.return: Map<String, Object>
focal_method.signature: Map<String, Object> getSubProperties(Iterable<PropertySource<?>> propertySources, String prefix)