2424import org .apache .dubbo .config .ReferenceConfig ;
2525import org .apache .dubbo .config .RegistryConfig ;
2626import org .apache .dubbo .config .ServiceConfig ;
27- import org .junit .AfterClass ;
28- import org .junit .Assert ;
29- import org .junit .BeforeClass ;
30- import org .junit .Test ;
27+ import org .junit .jupiter . api . AfterAll ;
28+ import org .junit .jupiter . api . Assertions ;
29+ import org .junit .jupiter . api . BeforeAll ;
30+ import org .junit .jupiter . api . Test ;
3131
3232/**
3333 */
@@ -45,9 +45,9 @@ public class SofaRegistryTest {
4545
4646 private static RegistryConfig registryConfig ;
4747
48- @ BeforeClass
48+ @ BeforeAll
4949 public static void beforeClass () {
50-
50+
5151 protocolConfig1 = new ProtocolConfig ();
5252 protocolConfig1 .setName ("dubbo" );
5353 protocolConfig1 .setPort (20890 );
@@ -59,7 +59,7 @@ public static void beforeClass() {
5959 registryConfig = new RegistryConfig ();
6060 registryConfig .setAddress ("sofa://127.0.0.1:9603" );
6161 registryConfig .setProtocol ("sofa" );
62-
62+
6363 registryMain = new TestRegistryMain ();
6464 try {
6565 registryMain .startRegistry ();
@@ -79,7 +79,7 @@ public void testPubAndSub() throws InterruptedException {
7979 serviceConfig1 .setGroup ("g1" );
8080 serviceConfig1 .setApplication (applicationConfig );
8181 serviceConfig1 .export ();
82-
82+
8383 ServiceConfig <HelloService > serviceConfig2 = new ServiceConfig <>();
8484 serviceConfig2 .setInterface (HelloService .class );
8585 serviceConfig2 .setRef (new HelloServiceImpl ("rrr22" ));
@@ -90,8 +90,8 @@ public void testPubAndSub() throws InterruptedException {
9090 serviceConfig2 .setRegister (false );
9191 serviceConfig2 .export ();
9292
93- Thread .sleep (1000 );
94-
93+ Thread .sleep (1000 );
94+
9595 // do refer
9696 ReferenceConfig <HelloService > referenceConfig1 = new ReferenceConfig <>();
9797 referenceConfig1 .setInterface (HelloService .class );
@@ -101,7 +101,7 @@ public void testPubAndSub() throws InterruptedException {
101101 referenceConfig1 .setRegistry (registryConfig );
102102 referenceConfig1 .setApplication (applicationConfig );
103103 HelloService service = referenceConfig1 .get ();
104- Assert .assertEquals ("rrr11" , service .sayHello ("xxx" ));
104+ Assertions .assertEquals ("rrr11" , service .sayHello ("xxx" ));
105105
106106 // do refer duplicated
107107 ReferenceConfig <HelloService > referenceConfig2 = new ReferenceConfig <>();
@@ -112,7 +112,7 @@ public void testPubAndSub() throws InterruptedException {
112112 referenceConfig2 .setRegistry (registryConfig );
113113 referenceConfig2 .setApplication (applicationConfig );
114114 HelloService service2 = referenceConfig2 .get ();
115- Assert .assertEquals ("rrr11" , service2 .sayHello ("xxx" ));
115+ Assertions .assertEquals ("rrr11" , service2 .sayHello ("xxx" ));
116116
117117 // export on service
118118 ServiceConfig <HelloService > serviceConfig3 = new ServiceConfig <>();
@@ -123,19 +123,19 @@ public void testPubAndSub() throws InterruptedException {
123123 serviceConfig3 .setGroup ("g1" );
124124 serviceConfig3 .setApplication (applicationConfig );
125125 serviceConfig3 .export ();
126- Assert .assertTrue (service2 .sayHello ("xxx" ).startsWith ("rrr1" ));
126+ Assertions .assertTrue (service2 .sayHello ("xxx" ).startsWith ("rrr1" ));
127127
128128 // unrefer
129129 referenceConfig1 .destroy ();
130- Assert .assertTrue (service2 .sayHello ("xxx" ).startsWith ("rrr1" ));
131-
130+ Assertions .assertTrue (service2 .sayHello ("xxx" ).startsWith ("rrr1" ));
131+
132132 // unexport on service
133133 serviceConfig1 .unexport ();
134134 Thread .sleep (2000 );
135- Assert .assertTrue (service2 .sayHello ("xxx" ).startsWith ("rrr1" ));
135+ Assertions .assertTrue (service2 .sayHello ("xxx" ).startsWith ("rrr1" ));
136136 }
137137
138- @ AfterClass
138+ @ AfterAll
139139 public static void afterClass () {
140140 try {
141141 registryMain .stopRegistry ();
0 commit comments