未验证 提交 4262b471 编写于 作者: Y Yuhao Bi 提交者: GitHub

Cleanup registry info after controller test cases (#291) (#292)

上级 fbd61e50
......@@ -24,6 +24,8 @@ import org.apache.dubbo.admin.model.dto.AccessDTO;
import org.apache.dubbo.admin.model.dto.ConditionRouteDTO;
import org.apache.dubbo.admin.service.ProviderService;
import org.apache.dubbo.admin.service.RouteService;
import org.junit.After;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
......@@ -52,6 +54,13 @@ public class AccessesControllerTest extends AbstractSpringIntegrationTest {
@Autowired
private ObjectMapper objectMapper;
@After
public void tearDown() throws Exception {
if (zkClient.checkExists().forPath("/dubbo") != null) {
zkClient.delete().deletingChildrenIfNeeded().forPath("/dubbo");
}
}
@Test
public void searchAccess() throws IOException {
AccessDTO accessDTO = new AccessDTO();
......
......@@ -22,6 +22,8 @@ import org.apache.dubbo.admin.AbstractSpringIntegrationTest;
import org.apache.dubbo.admin.model.dto.BalancingDTO;
import org.apache.dubbo.admin.service.OverrideService;
import org.apache.dubbo.admin.service.ProviderService;
import org.junit.After;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
......@@ -56,6 +58,13 @@ public class LoadBalanceControllerTest extends AbstractSpringIntegrationTest {
@Autowired
private ObjectMapper objectMapper;
@After
public void tearDown() throws Exception {
if (zkClient.checkExists().forPath("/dubbo") != null) {
zkClient.delete().deletingChildrenIfNeeded().forPath("/dubbo");
}
}
@Test
public void createLoadbalance() throws IOException {
BalancingDTO balancingDTO = new BalancingDTO();
......
......@@ -21,6 +21,8 @@ import org.apache.dubbo.admin.AbstractSpringIntegrationTest;
import org.apache.dubbo.admin.common.util.Constants;
import org.apache.dubbo.admin.model.dto.ConfigDTO;
import org.apache.dubbo.admin.service.ProviderService;
import org.junit.After;
import org.junit.Test;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.core.ParameterizedTypeReference;
......@@ -45,6 +47,13 @@ public class ManagementControllerTest extends AbstractSpringIntegrationTest {
@MockBean
private ProviderService providerService;
@After
public void tearDown() throws Exception {
if (zkClient.checkExists().forPath("/dubbo") != null) {
zkClient.delete().deletingChildrenIfNeeded().forPath("/dubbo");
}
}
@Test
public void shouldCreateGlobalConfig() throws Exception {
ConfigDTO configDTO = new ConfigDTO();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册