This commit is contained in:
water.lyl 2018-10-31 22:17:02 +08:00
parent fa54918da1
commit 8a7d313771

View File

@ -82,6 +82,15 @@ public class ConfigAPI_ITCase {
@After
public void cleanup() throws Exception {
HttpResult result = null;
try {
List<String> 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<String> 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);
}