dubbo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject [dubbo] branch master updated: upgrade all spring-test version to 5.x to align with spring-framework (#6798)
Date Mon, 12 Oct 2020 05:29:19 GMT
This is an automated email from the ASF dual-hosted git repository.

hyunkun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new aa06e04  upgrade all spring-test version to 5.x to align with spring-framework (#6798)
aa06e04 is described below

commit aa06e048d54d3078c2c9db5a1b2032e9cbc6edfe
Author: Xin Wang <xin.victorwang@gmail.com>
AuthorDate: Mon Oct 12 13:28:59 2020 +0800

    upgrade all spring-test version to 5.x to align with spring-framework (#6798)
---
 dubbo-config/dubbo-config-spring/pom.xml           |  6 --
 .../org/apache/dubbo/config/spring/ConfigTest.java | 32 ++++----
 .../AnnotationPropertyValuesAdapterTest.java       | 80 +++++++++---------
 .../annotation/DubboReferenceGenericTest.java      | 11 ++-
 .../factory/annotation/MergedAnnotationTest.java   | 20 ++---
 .../ReferenceAnnotationBeanPostProcessorTest.java  | 73 ++++++++--------
 .../annotation/ReferenceBeanBuilderTest.java       | 96 +++++++++++-----------
 .../ServiceAnnotationBeanPostProcessorTest.java    | 33 ++++----
 .../annotation/ServiceBeanNameBuilderTest.java     | 16 ++--
 .../annotation/ServiceClassPostProcessorTest.java  | 32 ++++----
 .../MultipleServicesWithMethodConfigsTest.java     |  8 +-
 .../config/YamlPropertySourceFactoryTest.java      | 22 ++---
 .../context/annotation/EnableDubboConfigTest.java  |  3 +-
 .../properties/DefaultDubboConfigBinderTest.java   | 17 ++--
 .../registry/nacos/nacos/NacosServiceNameTest.java |  4 +-
 .../config/spring/schema/GenericServiceTest.java   | 20 ++---
 .../spring/status/SpringStatusCheckerTest.java     |  4 +-
 dubbo-dependencies-bom/pom.xml                     |  3 +-
 pom.xml                                            |  2 +-
 19 files changed, 233 insertions(+), 249 deletions(-)

diff --git a/dubbo-config/dubbo-config-spring/pom.xml b/dubbo-config/dubbo-config-spring/pom.xml
index 31bfcf4..ae7f3bc 100644
--- a/dubbo-config/dubbo-config-spring/pom.xml
+++ b/dubbo-config/dubbo-config-spring/pom.xml
@@ -131,12 +131,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.tomcat.embed</groupId>
             <artifactId>tomcat-embed-core</artifactId>
             <scope>test</scope>
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java
index 6269258..3194bb8 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java
@@ -47,9 +47,9 @@ import org.apache.dubbo.rpc.RpcContext;
 import org.apache.dubbo.rpc.RpcException;
 import org.apache.dubbo.rpc.service.GenericService;
 
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.BeanCreationException;
 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -59,19 +59,19 @@ import java.util.List;
 
 import static org.apache.dubbo.common.constants.CommonConstants.GENERIC_SERIALIZATION_BEAN;
 import static org.apache.dubbo.rpc.Constants.GENERIC_KEY;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.matchers.JUnitMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail ;
+import static org.hamcrest.Matchers.containsString;
 
 
 /**
  * ConfigTest
  */
-@Ignore
+@Disabled
 public class ConfigTest {
 
     @Test
@@ -935,7 +935,7 @@ public class ConfigTest {
                     .service(service)
                     .start();
 
-            Assert.assertEquals(port, service.getExportedUrls().get(0).getPort());
+            Assertions.assertEquals(port, service.getExportedUrls().get(0).getPort());
         } finally {
             if (StringUtils.isNotEmpty(dubboPort)) {
                 System.setProperty("dubbo.protocol.dubbo.port", dubboPort);
@@ -984,7 +984,7 @@ public class ConfigTest {
         try {
             bootstrap.start();
 
-            Assert.assertEquals(demoService.getExportedUrls().get(0).getPort(),
+            Assertions.assertEquals(demoService.getExportedUrls().get(0).getPort(),
                     helloService.getExportedUrls().get(0).getPort());
         } finally {
             bootstrap.stop();
@@ -1011,7 +1011,7 @@ public class ConfigTest {
                 .reference(ref);
         try {
             bootstrap.start();
-            Assert.fail();
+            Assertions.fail();
         } catch (Exception e) {
             e.printStackTrace();
         } finally {
@@ -1035,7 +1035,7 @@ public class ConfigTest {
             Collection<Registry> collection = MockRegistryFactory.getCachedRegistry();
             MockRegistry registry = (MockRegistry) collection.iterator().next();
             URL url = registry.getRegistered().get(0);
-            Assert.assertEquals(GENERIC_SERIALIZATION_BEAN, url.getParameter(GENERIC_KEY));
+            Assertions.assertEquals(GENERIC_SERIALIZATION_BEAN, url.getParameter(GENERIC_KEY));
         } finally {
             MockRegistryFactory.cleanCachedRegistry();
             bootstrap.stop();
@@ -1049,7 +1049,7 @@ public class ConfigTest {
             ctx.start();
             ServiceConfig serviceConfig = (ServiceConfig) ctx.getBean("dubboDemoService");
             URL url = (URL) serviceConfig.getExportedUrls().get(0);
-            Assert.assertEquals(GENERIC_SERIALIZATION_BEAN, url.getParameter(GENERIC_KEY));
+            Assertions.assertEquals(GENERIC_SERIALIZATION_BEAN, url.getParameter(GENERIC_KEY));
         } finally {
             ctx.destroy();
         }
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java
index d51fe3c..5082682 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/AnnotationPropertyValuesAdapterTest.java
@@ -22,8 +22,8 @@ import org.apache.dubbo.config.annotation.Reference;
 import org.apache.dubbo.config.spring.ReferenceBean;
 import org.apache.dubbo.config.spring.api.DemoService;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.core.annotation.AnnotationUtils;
 import org.springframework.core.convert.converter.Converter;
 import org.springframework.core.convert.support.DefaultConversionService;
@@ -89,49 +89,49 @@ public class AnnotationPropertyValuesAdapterTest {
 
 //        System.out.println(referenceBean);
 
-        Assert.assertEquals(DemoService.class, referenceBean.getInterfaceClass());
-        Assert.assertEquals("org.apache.dubbo.config.spring.api.DemoService", referenceBean.getInterface());
-        Assert.assertEquals("1.0.0", referenceBean.getVersion());
-        Assert.assertEquals("group", referenceBean.getGroup());
-        Assert.assertEquals("dubbo://localhost:12345", referenceBean.getUrl());
-        Assert.assertEquals("client", referenceBean.getClient());
-        Assert.assertEquals(true, referenceBean.isGeneric());
-        Assert.assertNull(referenceBean.isInjvm());
-        Assert.assertEquals(false, referenceBean.isCheck());
-        Assert.assertEquals(true, referenceBean.isInit());
-        Assert.assertEquals(true, referenceBean.getLazy());
-        Assert.assertEquals(true, referenceBean.getStubevent());
-        Assert.assertEquals("reconnect", referenceBean.getReconnect());
-        Assert.assertEquals(true, referenceBean.getSticky());
-
-        Assert.assertEquals("javassist", referenceBean.getProxy());
-
-        Assert.assertEquals("stub", referenceBean.getStub());
-        Assert.assertEquals("failover", referenceBean.getCluster());
-        Assert.assertEquals(Integer.valueOf(1), referenceBean.getConnections());
-        Assert.assertEquals(Integer.valueOf(1), referenceBean.getCallbacks());
-        Assert.assertEquals("onconnect", referenceBean.getOnconnect());
-        Assert.assertEquals("ondisconnect", referenceBean.getOndisconnect());
-        Assert.assertEquals("owner", referenceBean.getOwner());
-        Assert.assertEquals("layer", referenceBean.getLayer());
-        Assert.assertEquals(Integer.valueOf(1), referenceBean.getRetries());
-        Assert.assertEquals("random", referenceBean.getLoadbalance());
-        Assert.assertEquals(true, referenceBean.isAsync());
-        Assert.assertEquals(Integer.valueOf(1), referenceBean.getActives());
-        Assert.assertEquals(true, referenceBean.getSent());
-        Assert.assertEquals("mock", referenceBean.getMock());
-        Assert.assertEquals("validation", referenceBean.getValidation());
-        Assert.assertEquals(Integer.valueOf(2), referenceBean.getTimeout());
-        Assert.assertEquals("cache", referenceBean.getCache());
-        Assert.assertEquals("default,default", referenceBean.getFilter());
-        Assert.assertEquals("default,default", referenceBean.getListener());
+        Assertions.assertEquals(DemoService.class, referenceBean.getInterfaceClass());
+        Assertions.assertEquals("org.apache.dubbo.config.spring.api.DemoService", referenceBean.getInterface());
+        Assertions.assertEquals("1.0.0", referenceBean.getVersion());
+        Assertions.assertEquals("group", referenceBean.getGroup());
+        Assertions.assertEquals("dubbo://localhost:12345", referenceBean.getUrl());
+        Assertions.assertEquals("client", referenceBean.getClient());
+        Assertions.assertEquals(true, referenceBean.isGeneric());
+        Assertions.assertNull(referenceBean.isInjvm());
+        Assertions.assertEquals(false, referenceBean.isCheck());
+        Assertions.assertEquals(true, referenceBean.isInit());
+        Assertions.assertEquals(true, referenceBean.getLazy());
+        Assertions.assertEquals(true, referenceBean.getStubevent());
+        Assertions.assertEquals("reconnect", referenceBean.getReconnect());
+        Assertions.assertEquals(true, referenceBean.getSticky());
+
+        Assertions.assertEquals("javassist", referenceBean.getProxy());
+
+        Assertions.assertEquals("stub", referenceBean.getStub());
+        Assertions.assertEquals("failover", referenceBean.getCluster());
+        Assertions.assertEquals(Integer.valueOf(1), referenceBean.getConnections());
+        Assertions.assertEquals(Integer.valueOf(1), referenceBean.getCallbacks());
+        Assertions.assertEquals("onconnect", referenceBean.getOnconnect());
+        Assertions.assertEquals("ondisconnect", referenceBean.getOndisconnect());
+        Assertions.assertEquals("owner", referenceBean.getOwner());
+        Assertions.assertEquals("layer", referenceBean.getLayer());
+        Assertions.assertEquals(Integer.valueOf(1), referenceBean.getRetries());
+        Assertions.assertEquals("random", referenceBean.getLoadbalance());
+        Assertions.assertEquals(true, referenceBean.isAsync());
+        Assertions.assertEquals(Integer.valueOf(1), referenceBean.getActives());
+        Assertions.assertEquals(true, referenceBean.getSent());
+        Assertions.assertEquals("mock", referenceBean.getMock());
+        Assertions.assertEquals("validation", referenceBean.getValidation());
+        Assertions.assertEquals(Integer.valueOf(2), referenceBean.getTimeout());
+        Assertions.assertEquals("cache", referenceBean.getCache());
+        Assertions.assertEquals("default,default", referenceBean.getFilter());
+        Assertions.assertEquals("default,default", referenceBean.getListener());
 
         Map<String, String> data = new LinkedHashMap<String, String>();
         data.put("key1", "value1");
 
-        Assert.assertEquals(data, referenceBean.getParameters());
+        Assertions.assertEquals(data, referenceBean.getParameters());
         // Bean compare
-        Assert.assertNull(referenceBean.getRegistry());
+        Assertions.assertNull(referenceBean.getRegistry());
 
     }
 
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/DubboReferenceGenericTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/DubboReferenceGenericTest.java
index 7fb2d1b..73edcfe 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/DubboReferenceGenericTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/DubboReferenceGenericTest.java
@@ -18,17 +18,16 @@ package org.apache.dubbo.config.spring.beans.factory.annotation;
 
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.spring.api.HelloService;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 import static org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.BEAN_NAME;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * {@link DubboReference @DubboReference} of Generic injection test
@@ -36,7 +35,7 @@ import static org.junit.Assert.assertEquals;
  * @see DubboReference
  * @since 2.7.9
  */
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @ContextConfiguration(
         classes = {
                 ServiceAnnotationTestConfiguration.class,
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/MergedAnnotationTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/MergedAnnotationTest.java
index 766b215..8abe1da 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/MergedAnnotationTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/MergedAnnotationTest.java
@@ -22,8 +22,8 @@ import org.apache.dubbo.config.spring.annotation.merged.MergedReference;
 import org.apache.dubbo.config.spring.annotation.merged.MergedService;
 import org.apache.dubbo.config.spring.api.DemoService;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.springframework.core.annotation.AnnotatedElementUtils;
 import org.springframework.util.ReflectionUtils;
 
@@ -35,24 +35,24 @@ public class MergedAnnotationTest {
     public void testMergedReference() {
         Field field = ReflectionUtils.findField(TestBean1.class, "demoService");
         Reference reference = AnnotatedElementUtils.getMergedAnnotation(field, Reference.class);
-        Assert.assertEquals("dubbo", reference.group());
-        Assert.assertEquals("1.0.0", reference.version());
+        Assertions.assertEquals("dubbo", reference.group());
+        Assertions.assertEquals("1.0.0", reference.version());
 
         Field field2 = ReflectionUtils.findField(TestBean2.class, "demoService");
         Reference reference2 = AnnotatedElementUtils.getMergedAnnotation(field2, Reference.class);
-        Assert.assertEquals("group", reference2.group());
-        Assert.assertEquals("2.0", reference2.version());
+        Assertions.assertEquals("group", reference2.group());
+        Assertions.assertEquals("2.0", reference2.version());
     }
 
     @Test
     public void testMergedService() {
         Service service1 = AnnotatedElementUtils.getMergedAnnotation(DemoServiceImpl1.class, Service.class);
-        Assert.assertEquals("dubbo", service1.group());
-        Assert.assertEquals("1.0.0", service1.version());
+        Assertions.assertEquals("dubbo", service1.group());
+        Assertions.assertEquals("1.0.0", service1.version());
 
         Service service2 = AnnotatedElementUtils.getMergedAnnotation(DemoServiceImpl2.class, Service.class);
-        Assert.assertEquals("group", service2.group());
-        Assert.assertEquals("2.0", service2.version());
+        Assertions.assertEquals("group", service2.group());
+        Assertions.assertEquals("2.0", service2.version());
     }
 
     @MergedService
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessorTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessorTest.java
index 598933d..ba342ac 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessorTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessorTest.java
@@ -23,15 +23,14 @@ import org.apache.dubbo.config.spring.api.DemoService;
 import org.apache.dubbo.config.spring.api.HelloService;
 import org.apache.dubbo.config.utils.ReferenceConfigCache;
 import org.apache.dubbo.rpc.model.ApplicationModel;
-
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.InjectionMetadata;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -42,20 +41,20 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.stereotype.Component;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 import java.util.Collection;
 import java.util.Map;
 
 import static org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.BEAN_NAME;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * {@link ReferenceAnnotationBeanPostProcessor} Test
  *
  * @since 2.5.7
  */
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @ContextConfiguration(
         classes = {
                 ServiceAnnotationTestConfiguration.class,
@@ -70,13 +69,13 @@ import static org.junit.Assert.assertTrue;
 @EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
 public class ReferenceAnnotationBeanPostProcessorTest {
 
-    @Before
-    public void setUp() {
+    @BeforeAll
+    public static void setUp() {
         ApplicationModel.reset();
     }
 
-    @After
-    public void tearDown() {
+    @AfterAll
+    public static void tearDown() {
         ApplicationModel.reset();
     }
 
@@ -131,35 +130,35 @@ public class ReferenceAnnotationBeanPostProcessorTest {
         DemoService demoService = testBean.getDemoService();
         Map<String, DemoService> demoServicesMap = context.getBeansOfType(DemoService.class);
 
-        Assert.assertNotNull(testBean.getDemoServiceFromAncestor());
-        Assert.assertNotNull(testBean.getDemoServiceFromParent());
-        Assert.assertNotNull(testBean.getDemoService());
-        Assert.assertNotNull(testBean.autowiredDemoService);
-        Assert.assertEquals(1, demoServicesMap.size());
+        Assertions.assertNotNull(testBean.getDemoServiceFromAncestor());
+        Assertions.assertNotNull(testBean.getDemoServiceFromParent());
+        Assertions.assertNotNull(testBean.getDemoService());
+        Assertions.assertNotNull(testBean.autowiredDemoService);
+        Assertions.assertEquals(1, demoServicesMap.size());
 
         String expectedResult = "Hello,Mercy" + AOP_SUFFIX;
 
-        Assert.assertEquals(expectedResult, testBean.autowiredDemoService.sayName("Mercy"));
-        Assert.assertEquals(expectedResult, demoService.sayName("Mercy"));
-        Assert.assertEquals("Greeting, Mercy", defaultHelloService.sayHello("Mercy"));
-        Assert.assertEquals("Hello, Mercy", helloServiceImpl.sayHello("Mercy"));
-        Assert.assertEquals("Greeting, Mercy", helloService.sayHello("Mercy"));
+        Assertions.assertEquals(expectedResult, testBean.autowiredDemoService.sayName("Mercy"));
+        Assertions.assertEquals(expectedResult, demoService.sayName("Mercy"));
+        Assertions.assertEquals("Greeting, Mercy", defaultHelloService.sayHello("Mercy"));
+        Assertions.assertEquals("Hello, Mercy", helloServiceImpl.sayHello("Mercy"));
+        Assertions.assertEquals("Greeting, Mercy", helloService.sayHello("Mercy"));
 
 
-        Assert.assertEquals(expectedResult, testBean.getDemoServiceFromAncestor().sayName("Mercy"));
-        Assert.assertEquals(expectedResult, testBean.getDemoServiceFromParent().sayName("Mercy"));
-        Assert.assertEquals(expectedResult, testBean.getDemoService().sayName("Mercy"));
+        Assertions.assertEquals(expectedResult, testBean.getDemoServiceFromAncestor().sayName("Mercy"));
+        Assertions.assertEquals(expectedResult, testBean.getDemoServiceFromParent().sayName("Mercy"));
+        Assertions.assertEquals(expectedResult, testBean.getDemoService().sayName("Mercy"));
 
         DemoService myDemoService = context.getBean("my-reference-bean", DemoService.class);
 
-        Assert.assertEquals(expectedResult, myDemoService.sayName("Mercy"));
+        Assertions.assertEquals(expectedResult, myDemoService.sayName("Mercy"));
 
 
         for (DemoService demoService1 : demoServicesMap.values()) {
 
-            Assert.assertEquals(myDemoService, demoService1);
+            Assertions.assertEquals(myDemoService, demoService1);
 
-            Assert.assertEquals(expectedResult, demoService1.sayName("Mercy"));
+            Assertions.assertEquals(expectedResult, demoService1.sayName("Mercy"));
         }
 
     }
@@ -175,11 +174,11 @@ public class ReferenceAnnotationBeanPostProcessorTest {
 
         Collection<ReferenceBean<?>> referenceBeans = beanPostProcessor.getReferenceBeans();
 
-        Assert.assertEquals(4, referenceBeans.size());
+        Assertions.assertEquals(4, referenceBeans.size());
 
         ReferenceBean<?> referenceBean = referenceBeans.iterator().next();
 
-        Assert.assertNotNull(ReferenceConfigCache.getCache().get(referenceBean));
+        Assertions.assertNotNull(ReferenceConfigCache.getCache().get(referenceBean));
 
     }
 
@@ -192,13 +191,13 @@ public class ReferenceAnnotationBeanPostProcessorTest {
         Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> referenceBeanMap =
                 beanPostProcessor.getInjectedFieldReferenceBeanMap();
 
-        Assert.assertEquals(3, referenceBeanMap.size());
+        Assertions.assertEquals(3, referenceBeanMap.size());
 
         for (Map.Entry<InjectionMetadata.InjectedElement, ReferenceBean<?>> entry : referenceBeanMap.entrySet()) {
 
             InjectionMetadata.InjectedElement injectedElement = entry.getKey();
 
-            Assert.assertEquals("com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement",
+            Assertions.assertEquals("com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedFieldElement",
                     injectedElement.getClass().getName());
 
         }
@@ -214,13 +213,13 @@ public class ReferenceAnnotationBeanPostProcessorTest {
         Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> referenceBeanMap =
                 beanPostProcessor.getInjectedMethodReferenceBeanMap();
 
-        Assert.assertEquals(2, referenceBeanMap.size());
+        Assertions.assertEquals(2, referenceBeanMap.size());
 
         for (Map.Entry<InjectionMetadata.InjectedElement, ReferenceBean<?>> entry : referenceBeanMap.entrySet()) {
 
             InjectionMetadata.InjectedElement injectedElement = entry.getKey();
 
-            Assert.assertEquals("com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedMethodElement",
+            Assertions.assertEquals("com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor$AnnotatedMethodElement",
                     injectedElement.getClass().getName());
 
         }
@@ -309,12 +308,12 @@ public class ReferenceAnnotationBeanPostProcessorTest {
 
         Collection<ReferenceBean<?>> referenceBeans = beanPostProcessor.getReferenceBeans();
 
-        Assert.assertEquals(4, referenceBeans.size());
+        Assertions.assertEquals(4, referenceBeans.size());
 
         ReferenceBean<?> referenceBean = referenceBeans.iterator().next();
 
         if ("helloService".equals(referenceBean.getId())) {
-            Assert.assertNotNull(referenceBean.getMethods());
+            Assertions.assertNotNull(referenceBean.getMethods());
         }
     }
 
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceBeanBuilderTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceBeanBuilderTest.java
index 60837e2..16ec804 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceBeanBuilderTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceBeanBuilderTest.java
@@ -21,18 +21,16 @@ import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.Reference;
 import org.apache.dubbo.config.spring.ReferenceBean;
 import org.apache.dubbo.rpc.model.ApplicationModel;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
 import org.junit.jupiter.api.Assertions;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 import org.springframework.core.annotation.AnnotationAttributes;
 import org.springframework.core.annotation.AnnotationUtils;
 import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 import java.util.Collections;
 import java.util.HashMap;
@@ -50,7 +48,7 @@ import static org.springframework.util.ReflectionUtils.findField;
  * @see Reference
  * @since 2.6.4
  */
-@RunWith(SpringJUnit4ClassRunner.class)
+@ExtendWith(SpringExtension.class)
 @ContextConfiguration(classes = ReferenceBeanBuilderTest.class)
 public class ReferenceBeanBuilderTest {
 
@@ -80,8 +78,8 @@ public class ReferenceBeanBuilderTest {
     @Autowired
     private ApplicationContext context;
 
-    @Before
-    public void init() {
+    @BeforeAll
+    public static void init() {
         ApplicationModel.reset();
     }
 
@@ -92,54 +90,54 @@ public class ReferenceBeanBuilderTest {
         ReferenceBeanBuilder beanBuilder = ReferenceBeanBuilder.create(attributes, context);
         beanBuilder.interfaceClass(CharSequence.class);
         ReferenceBean referenceBean = beanBuilder.build();
-        Assert.assertEquals(CharSequence.class, referenceBean.getInterfaceClass());
-        Assert.assertEquals("1.0.0", referenceBean.getVersion());
-        Assert.assertEquals("TEST_GROUP", referenceBean.getGroup());
-        Assert.assertEquals("dubbo://localhost:12345", referenceBean.getUrl());
-        Assert.assertEquals("client", referenceBean.getClient());
-        Assert.assertEquals(true, referenceBean.isGeneric());
-        Assert.assertTrue(referenceBean.isInjvm());
-        Assert.assertEquals(false, referenceBean.isCheck());
-        Assert.assertFalse(referenceBean.isInit());
-        Assert.assertEquals(true, referenceBean.getLazy());
-        Assert.assertEquals(true, referenceBean.getStubevent());
-        Assert.assertEquals("reconnect", referenceBean.getReconnect());
-        Assert.assertEquals(true, referenceBean.getSticky());
-        Assert.assertEquals("javassist", referenceBean.getProxy());
-        Assert.assertEquals("java.lang.CharSequence", referenceBean.getStub());
-        Assert.assertEquals("failover", referenceBean.getCluster());
-        Assert.assertEquals(Integer.valueOf(3), referenceBean.getConnections());
-        Assert.assertEquals(Integer.valueOf(1), referenceBean.getCallbacks());
-        Assert.assertEquals("onconnect", referenceBean.getOnconnect());
-        Assert.assertEquals("ondisconnect", referenceBean.getOndisconnect());
-        Assert.assertEquals("owner", referenceBean.getOwner());
-        Assert.assertEquals("layer", referenceBean.getLayer());
-        Assert.assertEquals(Integer.valueOf(1), referenceBean.getRetries());
-        Assert.assertEquals("random", referenceBean.getLoadbalance());
-        Assert.assertEquals(true, referenceBean.isAsync());
-        Assert.assertEquals(Integer.valueOf(3), referenceBean.getActives());
-        Assert.assertEquals(true, referenceBean.getSent());
-        Assert.assertEquals("mock", referenceBean.getMock());
-        Assert.assertEquals("validation", referenceBean.getValidation());
-        Assert.assertEquals(Integer.valueOf(3), referenceBean.getTimeout());
-        Assert.assertEquals("cache", referenceBean.getCache());
-        Assert.assertEquals("echo,generic,accesslog", referenceBean.getFilter());
-        Assert.assertEquals("deprecated", referenceBean.getListener());
-        Assert.assertEquals("reference", referenceBean.getId());
-        Assert.assertEquals(ofSet("service1", "service2", "service3"), referenceBean.getSubscribedServices());
+        Assertions.assertEquals(CharSequence.class, referenceBean.getInterfaceClass());
+        Assertions.assertEquals("1.0.0", referenceBean.getVersion());
+        Assertions.assertEquals("TEST_GROUP", referenceBean.getGroup());
+        Assertions.assertEquals("dubbo://localhost:12345", referenceBean.getUrl());
+        Assertions.assertEquals("client", referenceBean.getClient());
+        Assertions.assertEquals(true, referenceBean.isGeneric());
+        Assertions.assertTrue(referenceBean.isInjvm());
+        Assertions.assertEquals(false, referenceBean.isCheck());
+        Assertions.assertFalse(referenceBean.isInit());
+        Assertions.assertEquals(true, referenceBean.getLazy());
+        Assertions.assertEquals(true, referenceBean.getStubevent());
+        Assertions.assertEquals("reconnect", referenceBean.getReconnect());
+        Assertions.assertEquals(true, referenceBean.getSticky());
+        Assertions.assertEquals("javassist", referenceBean.getProxy());
+        Assertions.assertEquals("java.lang.CharSequence", referenceBean.getStub());
+        Assertions.assertEquals("failover", referenceBean.getCluster());
+        Assertions.assertEquals(Integer.valueOf(3), referenceBean.getConnections());
+        Assertions.assertEquals(Integer.valueOf(1), referenceBean.getCallbacks());
+        Assertions.assertEquals("onconnect", referenceBean.getOnconnect());
+        Assertions.assertEquals("ondisconnect", referenceBean.getOndisconnect());
+        Assertions.assertEquals("owner", referenceBean.getOwner());
+        Assertions.assertEquals("layer", referenceBean.getLayer());
+        Assertions.assertEquals(Integer.valueOf(1), referenceBean.getRetries());
+        Assertions.assertEquals("random", referenceBean.getLoadbalance());
+        Assertions.assertEquals(true, referenceBean.isAsync());
+        Assertions.assertEquals(Integer.valueOf(3), referenceBean.getActives());
+        Assertions.assertEquals(true, referenceBean.getSent());
+        Assertions.assertEquals("mock", referenceBean.getMock());
+        Assertions.assertEquals("validation", referenceBean.getValidation());
+        Assertions.assertEquals(Integer.valueOf(3), referenceBean.getTimeout());
+        Assertions.assertEquals("cache", referenceBean.getCache());
+        Assertions.assertEquals("echo,generic,accesslog", referenceBean.getFilter());
+        Assertions.assertEquals("deprecated", referenceBean.getListener());
+        Assertions.assertEquals("reference", referenceBean.getId());
+        Assertions.assertEquals(ofSet("service1", "service2", "service3"), referenceBean.getSubscribedServices());
 
         // parameters
         Map<String, String> parameters = new HashMap<String, String>();
         parameters.put("n1", "v1");
         parameters.put("n2", "v2");
         parameters.put("n3", "v3");
-        Assert.assertEquals(parameters, referenceBean.getParameters());
+        Assertions.assertEquals(parameters, referenceBean.getParameters());
 
         // Asserts Null fields
         Assertions.assertThrows(IllegalStateException.class, () -> referenceBean.getApplication());
-        Assert.assertNull(referenceBean.getModule());
-        Assert.assertNull(referenceBean.getConsumer());
-        Assert.assertNull(referenceBean.getMonitor());
-        Assert.assertEquals(Collections.emptyList(), referenceBean.getRegistries());
+        Assertions.assertNull(referenceBean.getModule());
+        Assertions.assertNull(referenceBean.getConsumer());
+        Assertions.assertNull(referenceBean.getMonitor());
+        Assertions.assertEquals(Collections.emptyList(), referenceBean.getRegistries());
     }
 }
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessorTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessorTest.java
index 171cda3..9adedda 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessorTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessorTest.java
@@ -19,19 +19,18 @@ package org.apache.dubbo.config.spring.beans.factory.annotation;
 import org.apache.dubbo.config.spring.ServiceBean;
 import org.apache.dubbo.config.spring.api.HelloService;
 import org.apache.dubbo.rpc.model.ApplicationModel;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.context.annotation.Bean;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 import java.util.Map;
 
@@ -40,7 +39,7 @@ import java.util.Map;
  *
  * @since 2.5.8
  */
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @ContextConfiguration(
         classes = {
                 ServiceAnnotationTestConfiguration.class,
@@ -52,12 +51,12 @@ import java.util.Map;
 })
 public class ServiceAnnotationBeanPostProcessorTest {
 
-    @Before
+    @BeforeEach
     public void setUp() {
         ApplicationModel.reset();
     }
 
-    @After
+    @AfterEach
     public void tearDown() {
         ApplicationModel.reset();
     }
@@ -76,19 +75,19 @@ public class ServiceAnnotationBeanPostProcessorTest {
 
         Map<String, HelloService> helloServicesMap = beanFactory.getBeansOfType(HelloService.class);
 
-        Assert.assertEquals(2, helloServicesMap.size());
+        Assertions.assertEquals(2, helloServicesMap.size());
 
         Map<String, ServiceBean> serviceBeansMap = beanFactory.getBeansOfType(ServiceBean.class);
 
-        Assert.assertEquals(2, serviceBeansMap.size());
+        Assertions.assertEquals(2, serviceBeansMap.size());
 
         Map<String, ServiceAnnotationBeanPostProcessor> beanPostProcessorsMap =
                 beanFactory.getBeansOfType(ServiceAnnotationBeanPostProcessor.class);
 
-        Assert.assertEquals(2, beanPostProcessorsMap.size());
+        Assertions.assertEquals(2, beanPostProcessorsMap.size());
 
-        Assert.assertTrue(beanPostProcessorsMap.containsKey("serviceAnnotationBeanPostProcessor"));
-        Assert.assertTrue(beanPostProcessorsMap.containsKey("serviceAnnotationBeanPostProcessor2"));
+        Assertions.assertTrue(beanPostProcessorsMap.containsKey("serviceAnnotationBeanPostProcessor"));
+        Assertions.assertTrue(beanPostProcessorsMap.containsKey("serviceAnnotationBeanPostProcessor2"));
 
     }
 
@@ -97,11 +96,11 @@ public class ServiceAnnotationBeanPostProcessorTest {
 
         Map<String, ServiceBean> serviceBeansMap = beanFactory.getBeansOfType(ServiceBean.class);
 
-        Assert.assertEquals(2, serviceBeansMap.size());
+        Assertions.assertEquals(2, serviceBeansMap.size());
 
         ServiceBean demoServiceBean = serviceBeansMap.get("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:2.5.7");
 
-        Assert.assertNotNull(demoServiceBean.getMethods());
+        Assertions.assertNotNull(demoServiceBean.getMethods());
 
     }
 
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceBeanNameBuilderTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceBeanNameBuilderTest.java
index 747fc1e..acb59f1 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceBeanNameBuilderTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceBeanNameBuilderTest.java
@@ -19,10 +19,10 @@ package org.apache.dubbo.config.spring.beans.factory.annotation;
 import org.apache.dubbo.config.annotation.Reference;
 import org.apache.dubbo.config.annotation.Service;
 import org.apache.dubbo.config.spring.api.DemoService;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.springframework.core.annotation.AnnotationUtils;
 import org.springframework.mock.env.MockEnvironment;
 import org.springframework.util.ReflectionUtils;
@@ -50,7 +50,7 @@ public class ServiceBeanNameBuilderTest {
 
     private MockEnvironment environment;
 
-    @Before
+    @BeforeEach
     public void prepare() {
         environment = new MockEnvironment();
         environment.setProperty("dubbo.version", "1.0.0");
@@ -60,10 +60,10 @@ public class ServiceBeanNameBuilderTest {
     public void testServiceAnnotation() {
         Service service = AnnotationUtils.getAnnotation(ServiceBeanNameBuilderTest.class, Service.class);
         ServiceBeanNameBuilder builder = ServiceBeanNameBuilder.create(service, INTERFACE_CLASS, environment);
-        Assert.assertEquals("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:1.0.0:DUBBO",
+        Assertions.assertEquals("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:1.0.0:DUBBO",
                 builder.build());
 
-        Assert.assertEquals("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:1.0.0:DUBBO",
+        Assertions.assertEquals("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:1.0.0:DUBBO",
                 builder.build());
     }
 
@@ -71,7 +71,7 @@ public class ServiceBeanNameBuilderTest {
     public void testReferenceAnnotation() {
         Reference reference = AnnotationUtils.getAnnotation(ReflectionUtils.findField(ServiceBeanNameBuilderTest.class, "INTERFACE_CLASS"), Reference.class);
         ServiceBeanNameBuilder builder = ServiceBeanNameBuilder.create(reference, INTERFACE_CLASS, environment);
-        Assert.assertEquals("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:1.0.0:DUBBO",
+        Assertions.assertEquals("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:1.0.0:DUBBO",
                 builder.build());
     }
 
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceClassPostProcessorTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceClassPostProcessorTest.java
index e6c1d77..b28ae2e 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceClassPostProcessorTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/annotation/ServiceClassPostProcessorTest.java
@@ -19,19 +19,17 @@ package org.apache.dubbo.config.spring.beans.factory.annotation;
 import org.apache.dubbo.config.spring.ServiceBean;
 import org.apache.dubbo.config.spring.api.HelloService;
 import org.apache.dubbo.rpc.model.ApplicationModel;
-
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.context.annotation.Bean;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 import java.util.Map;
 
@@ -40,7 +38,7 @@ import java.util.Map;
  *
  * @since 2.7.7
  */
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @ContextConfiguration(
         classes = {
                 ServiceAnnotationTestConfiguration2.class,
@@ -52,12 +50,12 @@ import java.util.Map;
 })
 public class ServiceClassPostProcessorTest {
 
-    @Before
+    @BeforeEach
     public void setUp() {
         ApplicationModel.reset();
     }
 
-    @After
+    @BeforeEach
     public void tearDown() {
         ApplicationModel.reset();
     }
@@ -76,19 +74,19 @@ public class ServiceClassPostProcessorTest {
 
         Map<String, HelloService> helloServicesMap = beanFactory.getBeansOfType(HelloService.class);
 
-        Assert.assertEquals(2, helloServicesMap.size());
+        Assertions.assertEquals(2, helloServicesMap.size());
 
         Map<String, ServiceBean> serviceBeansMap = beanFactory.getBeansOfType(ServiceBean.class);
 
-        Assert.assertEquals(2, serviceBeansMap.size());
+        Assertions.assertEquals(2, serviceBeansMap.size());
 
         Map<String, ServiceClassPostProcessor> beanPostProcessorsMap =
                 beanFactory.getBeansOfType(ServiceClassPostProcessor.class);
 
-        Assert.assertEquals(2, beanPostProcessorsMap.size());
+        Assertions.assertEquals(2, beanPostProcessorsMap.size());
 
-        Assert.assertTrue(beanPostProcessorsMap.containsKey("serviceClassPostProcessor"));
-        Assert.assertTrue(beanPostProcessorsMap.containsKey("serviceClassPostProcessor2"));
+        Assertions.assertTrue(beanPostProcessorsMap.containsKey("serviceClassPostProcessor"));
+        Assertions.assertTrue(beanPostProcessorsMap.containsKey("serviceClassPostProcessor2"));
 
     }
 
@@ -97,11 +95,11 @@ public class ServiceClassPostProcessorTest {
 
         Map<String, ServiceBean> serviceBeansMap = beanFactory.getBeansOfType(ServiceBean.class);
 
-        Assert.assertEquals(2, serviceBeansMap.size());
+        Assertions.assertEquals(2, serviceBeansMap.size());
 
         ServiceBean demoServiceBean = serviceBeansMap.get("ServiceBean:org.apache.dubbo.config.spring.api.DemoService:2.5.7");
 
-        Assert.assertNotNull(demoServiceBean.getMethods());
+        Assertions.assertNotNull(demoServiceBean.getMethods());
 
     }
 
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/MultipleServicesWithMethodConfigsTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/MultipleServicesWithMethodConfigsTest.java
index d66c8c3..6bd8585 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/MultipleServicesWithMethodConfigsTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/MultipleServicesWithMethodConfigsTest.java
@@ -16,15 +16,15 @@
  */
 package org.apache.dubbo.config.spring.beans.factory.config;
 
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.ImportResource;
 import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @ContextConfiguration(classes = MultipleServicesWithMethodConfigsTest.class)
 @ImportResource(locations = "classpath:/META-INF/spring/multiple-services-with-methods.xml")
 public class MultipleServicesWithMethodConfigsTest {
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/YamlPropertySourceFactoryTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/YamlPropertySourceFactoryTest.java
index a9861d3..76815ea 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/YamlPropertySourceFactoryTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/beans/factory/config/YamlPropertySourceFactoryTest.java
@@ -16,23 +16,23 @@
  */
 package org.apache.dubbo.config.spring.beans.factory.config;
 
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.PropertySource;
 import org.springframework.core.env.Environment;
 import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
 /**
  * {@link YamlPropertySourceFactory} Test
  *
  * @since 2.6.5
  */
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @PropertySource(name = "yaml-source", value = {"classpath:/META-INF/dubbo.yml"}, factory = YamlPropertySourceFactory.class)
 @Configuration
 @ContextConfiguration(classes = YamlPropertySourceFactoryTest.class)
@@ -61,11 +61,11 @@ public class YamlPropertySourceFactoryTest {
 
     @Test
     public void testProperty() {
-        Assert.assertEquals(isDefault, environment.getProperty("dubbo.consumer.default", Boolean.class));
-        Assert.assertEquals(client, environment.getProperty("dubbo.consumer.client", String.class));
-        Assert.assertEquals(threadPool, environment.getProperty("dubbo.consumer.threadpool", String.class));
-        Assert.assertEquals(coreThreads, environment.getProperty("dubbo.consumer.corethreads", Integer.class));
-        Assert.assertEquals(threads, environment.getProperty("dubbo.consumer.threads", Integer.class));
-        Assert.assertEquals(queues, environment.getProperty("dubbo.consumer.queues", Integer.class));
+        Assertions.assertEquals(isDefault, environment.getProperty("dubbo.consumer.default", Boolean.class));
+        Assertions.assertEquals(client, environment.getProperty("dubbo.consumer.client", String.class));
+        Assertions.assertEquals(threadPool, environment.getProperty("dubbo.consumer.threadpool", String.class));
+        Assertions.assertEquals(coreThreads, environment.getProperty("dubbo.consumer.corethreads", Integer.class));
+        Assertions.assertEquals(threads, environment.getProperty("dubbo.consumer.threads", Integer.class));
+        Assertions.assertEquals(queues, environment.getProperty("dubbo.consumer.queues", Integer.class));
     }
 }
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/annotation/EnableDubboConfigTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/annotation/EnableDubboConfigTest.java
index 5817185..c27b9da 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/annotation/EnableDubboConfigTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/annotation/EnableDubboConfigTest.java
@@ -24,7 +24,6 @@ import org.apache.dubbo.config.ProtocolConfig;
 import org.apache.dubbo.config.ProviderConfig;
 import org.apache.dubbo.config.RegistryConfig;
 
-import org.junit.Assert;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -108,7 +107,7 @@ public class EnableDubboConfigTest {
 
         for (Map.Entry<String, ProtocolConfig> entry : protocolConfigs.entrySet()) {
             ProtocolConfig protocol = entry.getValue();
-            Assert.assertEquals(protocol, context.getBean(protocol.getName(), ProtocolConfig.class));
+            Assertions.assertEquals(protocol, context.getBean(protocol.getName(), ProtocolConfig.class));
         }
 
         // asserts aliases
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/properties/DefaultDubboConfigBinderTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/properties/DefaultDubboConfigBinderTest.java
index 2123b54..8b9a818 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/properties/DefaultDubboConfigBinderTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/context/properties/DefaultDubboConfigBinderTest.java
@@ -21,28 +21,27 @@ import org.apache.dubbo.config.ApplicationConfig;
 import org.apache.dubbo.config.ProtocolConfig;
 import org.apache.dubbo.config.RegistryConfig;
 import org.apache.dubbo.rpc.model.ApplicationModel;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Assertions;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
 
-@RunWith(SpringJUnit4ClassRunner.class)
+@ExtendWith(SpringExtension.class)
 @TestPropertySource(locations = "classpath:/dubbo-binder.properties")
 @ContextConfiguration(classes = DefaultDubboConfigBinder.class)
 public class DefaultDubboConfigBinderTest {
 
-    @Before
+    @BeforeEach
     public void setUp() {
         ApplicationModel.reset();
     }
 
-    @After
+    @AfterEach
     public void tearDown() {
         ApplicationModel.reset();
     }
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/registry/nacos/nacos/NacosServiceNameTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/registry/nacos/nacos/NacosServiceNameTest.java
index f3a7380..5aa5783 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/registry/nacos/nacos/NacosServiceNameTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/registry/nacos/nacos/NacosServiceNameTest.java
@@ -23,8 +23,8 @@ import org.junit.jupiter.api.Test;
 
 import static org.apache.dubbo.common.constants.RegistryConstants.DEFAULT_CATEGORY;
 import static org.apache.dubbo.registry.nacos.NacosServiceName.WILDCARD;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/schema/GenericServiceTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/schema/GenericServiceTest.java
index 6deb2ab..d1d5ca5 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/schema/GenericServiceTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/schema/GenericServiceTest.java
@@ -19,30 +19,30 @@ package org.apache.dubbo.config.spring.schema;
 import org.apache.dubbo.config.spring.ReferenceBean;
 import org.apache.dubbo.config.spring.ServiceBean;
 import org.apache.dubbo.rpc.model.ApplicationModel;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.context.annotation.ImportResource;
 import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
-import static org.junit.Assert.assertNotNull;
 
-@RunWith(SpringRunner.class)
+@ExtendWith(SpringExtension.class)
 @ContextConfiguration(classes = GenericServiceTest.class)
 @ImportResource(locations = "classpath:/META-INF/spring/dubbo-generic-consumer.xml")
 public class GenericServiceTest {
 
-    @Before
+    @BeforeEach
     public void setUp() {
         ApplicationModel.reset();
     }
 
-    @After
+    @AfterEach
     public void tearDown() {
         ApplicationModel.reset();
     }
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/status/SpringStatusCheckerTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/status/SpringStatusCheckerTest.java
index e3386e2..9de3fb9 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/status/SpringStatusCheckerTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/status/SpringStatusCheckerTest.java
@@ -20,8 +20,8 @@ import org.apache.dubbo.common.status.Status;
 import org.apache.dubbo.config.spring.ServiceBean;
 import org.apache.dubbo.config.spring.extension.SpringExtensionFactory;
 
-import org.junit.Assert;
 import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.mockito.Mock;
@@ -99,6 +99,6 @@ public class SpringStatusCheckerTest {
         SpringExtensionFactory.addApplicationContext(context);
         SpringStatusChecker checker = new SpringStatusChecker();
         Status status = checker.check();
-        Assert.assertEquals(Status.Level.UNKNOWN, status.getLevel());
+        Assertions.assertEquals(Status.Level.UNKNOWN, status.getLevel());
     }
 }
diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml
index df6dc65..1ff5465 100644
--- a/dubbo-dependencies-bom/pom.xml
+++ b/dubbo-dependencies-bom/pom.xml
@@ -157,7 +157,6 @@
         <etcd_launcher_version>0.5.3</etcd_launcher_version>
         <hessian_lite_version>3.2.8</hessian_lite_version>
         <swagger_version>1.5.19</swagger_version>
-        <spring_test_version>4.3.16.RELEASE</spring_test_version>
 
         <metrics_version>2.0.1</metrics_version>
         <sofa_registry_version>5.2.0</sofa_registry_version>
@@ -630,7 +629,7 @@
             <dependency>
                 <groupId>org.springframework</groupId>
                 <artifactId>spring-test</artifactId>
-                <version>${spring_test_version}</version>
+                <version>${spring_version}</version>
                 <scope>test</scope>
             </dependency>
             <dependency>
diff --git a/pom.xml b/pom.xml
index aaf82da..a7d0b7e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,7 +119,7 @@
         <maven_javadoc_version>3.0.1</maven_javadoc_version>
         <maven_jetty_version>9.4.11.v20180605</maven_jetty_version>
         <maven_checkstyle_version>3.0.0</maven_checkstyle_version>
-        <maven_jacoco_version>0.8.2</maven_jacoco_version>
+        <maven_jacoco_version>0.8.6</maven_jacoco_version>
         <maven_flatten_version>1.1.0</maven_flatten_version>
         <maven_enforce_version>3.0.0-M2</maven_enforce_version>
         <apache-rat-plugin.version>0.12</apache-rat-plugin.version>


Mime
View raw message