From 0df5798147a7e65dc6183350baefc6ddda8e9d99 Mon Sep 17 00:00:00 2001 From: nkorange Date: Mon, 7 Jan 2019 21:17:31 +0800 Subject: [PATCH] #498 Update test case --- .../alibaba/nacos/test/naming/MultipleTenantTest.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/src/test/java/com/alibaba/nacos/test/naming/MultipleTenantTest.java b/test/src/test/java/com/alibaba/nacos/test/naming/MultipleTenantTest.java index 4f91ec561..c7829f2ba 100644 --- a/test/src/test/java/com/alibaba/nacos/test/naming/MultipleTenantTest.java +++ b/test/src/test/java/com/alibaba/nacos/test/naming/MultipleTenantTest.java @@ -24,14 +24,15 @@ import static com.alibaba.nacos.test.naming.NamingBase.*; /** * @author nkorange */ -//@RunWith(SpringRunner.class) -//@SpringBootTest(classes = NamingApp.class, properties = {"server.servlet.context-path=/nacos"}, -// webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@RunWith(SpringRunner.class) +@SpringBootTest(classes = NamingApp.class, properties = {"server.servlet.context-path=/nacos"}, + webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class MultipleTenantTest { private NamingService naming; private NamingService naming1; private NamingService naming2; + @LocalServerPort private int port; @@ -42,8 +43,6 @@ public class MultipleTenantTest { TimeUnit.SECONDS.sleep(10); - port = 8848; - naming = NamingFactory.createNamingService("127.0.0.1" + ":" + port); Properties properties = new Properties(); @@ -88,8 +87,6 @@ public class MultipleTenantTest { instances = naming.getAllInstances(serviceName); Assert.assertEquals(2, instances.size()); - - TimeUnit.SECONDS.sleep(10000000L); } @Test