add instance api
This commit is contained in:
parent
b75ea9f333
commit
ca4a303d08
@ -20,6 +20,8 @@ import java.util.List;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import javax.swing.text.View;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@ -258,6 +260,7 @@ public class CPInstancesAPI_ITCase {
|
|||||||
@Test
|
@Test
|
||||||
public void listService() throws Exception {
|
public void listService() throws Exception {
|
||||||
String serviceName = NamingBase.randomDomainName();
|
String serviceName = NamingBase.randomDomainName();
|
||||||
|
ListView<String> listView = naming.getServicesOfServer(1, 50);
|
||||||
namingServiceCreate(serviceName, Constants.DEFAULT_NAMESPACE_ID);
|
namingServiceCreate(serviceName, Constants.DEFAULT_NAMESPACE_ID);
|
||||||
|
|
||||||
//get service
|
//get service
|
||||||
@ -273,7 +276,7 @@ public class CPInstancesAPI_ITCase {
|
|||||||
Assert.assertTrue(response.getStatusCode().is2xxSuccessful());
|
Assert.assertTrue(response.getStatusCode().is2xxSuccessful());
|
||||||
JSONObject json = JSON.parseObject(response.getBody());
|
JSONObject json = JSON.parseObject(response.getBody());
|
||||||
int count = json.getIntValue("count");
|
int count = json.getIntValue("count");
|
||||||
Assert.assertEquals(1, count);
|
Assert.assertEquals(listView.getCount()+1, count);
|
||||||
|
|
||||||
namingServiceDelete(serviceName, Constants.DEFAULT_NAMESPACE_ID);
|
namingServiceDelete(serviceName, Constants.DEFAULT_NAMESPACE_ID);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user