Fix the issues of test cases
diff --git a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java
index d9747cc..954ad7a 100644
--- a/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java
+++ b/dubbo-spring-boot-actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAnnotationAutoConfigurationTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.dubbo.spring.boot.actuate.autoconfigure;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.dubbo.config.annotation.Service;
 import org.apache.dubbo.spring.boot.actuate.endpoint.DubboConfigsMetadataEndpoint;
 import org.apache.dubbo.spring.boot.actuate.endpoint.DubboMetadataEndpoint;
@@ -25,6 +23,9 @@
 import org.apache.dubbo.spring.boot.actuate.endpoint.DubboReferencesMetadataEndpoint;
 import org.apache.dubbo.spring.boot.actuate.endpoint.DubboServicesMetadataEndpoint;
 import org.apache.dubbo.spring.boot.actuate.endpoint.DubboShutdownEndpoint;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -159,7 +160,7 @@
 
         Assert.assertEquals(1, services.size());
 
-        Map<String, Object> demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfigurationTest$DemoService:1.0.0");
+        Map<String, Object> demoServiceMeta = services.get("providers:my-protocol:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAnnotationAutoConfigurationTest$DemoService:1.0.0");
 
         Assert.assertEquals("1.0.0", demoServiceMeta.get("version"));
 
diff --git a/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java
index 9f5f51e..3227723 100644
--- a/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java
+++ b/dubbo-spring-boot-compatible/actuator/src/test/java/org/apache/dubbo/spring/boot/actuate/autoconfigure/DubboEndpointAutoConfigurationTest.java
@@ -16,8 +16,6 @@
  */
 package org.apache.dubbo.spring.boot.actuate.autoconfigure;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.dubbo.config.annotation.Service;
 import org.apache.dubbo.spring.boot.actuate.endpoint.DubboEndpoint;
 import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboConfigsMetadata;
@@ -25,6 +23,9 @@
 import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboReferencesMetadata;
 import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboServicesMetadata;
 import org.apache.dubbo.spring.boot.actuate.endpoint.metadata.DubboShutdownMetadata;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -163,7 +164,7 @@
 
         Assert.assertEquals(1, services.size());
 
-        Map<String, Object> demoServiceMeta = services.get("ServiceBean:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfigurationTest$DemoService:1.0.0");
+        Map<String, Object> demoServiceMeta = services.get("providers:my-protocol:org.apache.dubbo.spring.boot.actuate.autoconfigure.DubboEndpointAutoConfigurationTest$DemoService:1.0.0");
 
         Assert.assertEquals("1.0.0", demoServiceMeta.get("version"));
 
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java
new file mode 100644
index 0000000..8b62c75
--- /dev/null
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/context/DubboApplicationContextInitializer.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.spring.boot.context;
+
+import org.apache.dubbo.config.AbstractConfig;
+import org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
+import org.springframework.context.ApplicationContextInitializer;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.core.Ordered;
+
+import java.lang.reflect.Method;
+
+import static org.apache.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer.BEAN_NAME;
+import static org.apache.dubbo.config.spring.util.BeanRegistrar.registerInfrastructureBean;
+import static org.springframework.util.ReflectionUtils.findMethod;
+import static org.springframework.util.ReflectionUtils.invokeMethod;
+
+/**
+ * Dubbo {@link ApplicationContextInitializer} implementation
+ *
+ * @see ApplicationContextInitializer
+ * @since 2.7.1
+ */
+public class DubboApplicationContextInitializer implements ApplicationContextInitializer, Ordered {
+
+    @Override
+    public void initialize(ConfigurableApplicationContext applicationContext) {
+        overrideBeanDefinitions(applicationContext);
+    }
+
+    private void overrideBeanDefinitions(ConfigurableApplicationContext applicationContext) {
+        applicationContext.addBeanFactoryPostProcessor(new OverrideBeanDefinitionRegistryPostProcessor());
+    }
+
+    @Override
+    public int getOrder() {
+        return HIGHEST_PRECEDENCE;
+    }
+
+    /**
+     * {@link BeanDefinitionRegistryPostProcessor}
+     */
+    private static class OverrideBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor {
+
+        @Override
+        public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
+            registerInfrastructureBean(registry, BEAN_NAME, DubboConfigBeanCustomizer.class);
+        }
+
+        @Override
+        public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
+        }
+    }
+
+    /**
+     * Current implementation will be replaced {@link NamePropertyDefaultValueDubboConfigBeanCustomizer} in Dubbo 2.7.2
+     */
+    private static class DubboConfigBeanCustomizer extends NamePropertyDefaultValueDubboConfigBeanCustomizer {
+        @Override
+        public void customize(String beanName, AbstractConfig dubboConfigBean) {
+            boolean valid = isValidPropertyName(dubboConfigBean, beanName);
+            if (valid) {
+                super.customize(beanName, dubboConfigBean);
+            }
+        }
+
+        private boolean isValidPropertyName(AbstractConfig dubboConfigBean, String propertyValue) {
+            boolean valid = true;
+            String propertyName = "name";
+            // AbstractConfig.checkName(String,String)
+            Method method = findMethod(AbstractConfig.class, "checkName", String.class, String.class);
+            try {
+                if (!method.isAccessible()) {
+                    method.setAccessible(true);
+                }
+                if (BeanUtils.getPropertyDescriptor(dubboConfigBean.getClass(), propertyName) != null) {
+                    invokeMethod(method, null, propertyName, propertyValue);
+                }
+            } catch (IllegalStateException e) {
+                valid = false;
+            }
+
+            return valid;
+        }
+    }
+}
diff --git a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories
index 08db894..e3005db 100644
--- a/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories
+++ b/dubbo-spring-boot-compatible/autoconfigure/src/main/resources/META-INF/spring.factories
@@ -6,4 +6,6 @@
 org.apache.dubbo.spring.boot.context.event.WelcomeLogoApplicationListener,\
 org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListener
 org.springframework.boot.env.EnvironmentPostProcessor=\
-org.apache.dubbo.spring.boot.env.DubboDefaultPropertiesEnvironmentPostProcessor
\ No newline at end of file
+org.apache.dubbo.spring.boot.env.DubboDefaultPropertiesEnvironmentPostProcessor
+org.springframework.context.ApplicationContextInitializer=\
+org.apache.dubbo.spring.boot.context.DubboApplicationContextInitializer
\ No newline at end of file