From 8a7d31377169dba63ff1ce3e87b1ecc9ab631be3 Mon Sep 17 00:00:00 2001 From: "water.lyl" Date: Wed, 31 Oct 2018 22:17:02 +0800 Subject: [PATCH] Fix #200 --- .../nacos/test/config/ConfigAPI_ITCase.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/src/test/java/com/alibaba/nacos/test/config/ConfigAPI_ITCase.java b/test/src/test/java/com/alibaba/nacos/test/config/ConfigAPI_ITCase.java index 50a6f296a..18fd52e51 100644 --- a/test/src/test/java/com/alibaba/nacos/test/config/ConfigAPI_ITCase.java +++ b/test/src/test/java/com/alibaba/nacos/test/config/ConfigAPI_ITCase.java @@ -82,6 +82,15 @@ public class ConfigAPI_ITCase { @After public void cleanup() throws Exception { + HttpResult result = null; + try { + List params = Arrays.asList("dataId", dataId, "group", group, "beta", "true"); + result = agent.httpDelete(CONFIG_CONTROLLER_PATH + "/", null, params, agent.getEncode(), TIME_OUT); + Assert.assertEquals(HttpURLConnection.HTTP_OK, result.code); + Assert.assertEquals(true, JSON.parseObject(result.content).getBoolean("data")); + } catch (Exception e) { + Assert.assertTrue(false); + } } /** @@ -186,7 +195,7 @@ public class ConfigAPI_ITCase { * @TCDescription : nacos_发布配置时包含特殊字符 * @throws Exception */ - @Test(timeout = 5*TIME_OUT) + @Test(timeout = 500*TIME_OUT) public void nacos_publishConfig_3() throws Exception { String content = "test" + SPECIAL_CHARACTERS; boolean result = iconfig.publishConfig(dataId, group, content); @@ -609,11 +618,13 @@ public class ConfigAPI_ITCase { Assert.assertEquals(HttpURLConnection.HTTP_OK, result.code); Assert.assertEquals("true", result.content); - List params = Arrays.asList("dataId", dataId, "group", group, "beta", "true"); result = agent.httpGet(CONFIG_CONTROLLER_PATH + "/", null, params, agent.getEncode(), TIME_OUT); Assert.assertEquals(HttpURLConnection.HTTP_OK, result.code); Assert.assertEquals(content, JSON.parseObject(result.content).getJSONObject("data").getString("content")); + // delete data + result = agent.httpDelete(CONFIG_CONTROLLER_PATH + "/", null, params, agent.getEncode(), TIME_OUT); + Assert.assertEquals(HttpURLConnection.HTTP_OK, result.code); } catch (Exception e) { Assert.assertTrue(false); }