diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java index 68e328237a..213f8a8b13 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/BaseApiTest.java @@ -202,49 +202,49 @@ protected static void initPropertyKey() { + "\"cardinality\": \"SINGLE\",\n" + "\"check_exist\": false,\n" + "\"properties\":[]\n" - + "}"); + + "}", 202); createAndAssert(path, "{\n" + "\"name\": \"age\",\n" + "\"data_type\": \"INT\",\n" + "\"cardinality\": \"SINGLE\",\n" + "\"check_exist\": false,\n" + "\"properties\":[]\n" - + "}"); + + "}", 202); createAndAssert(path, "{\n" + "\"name\": \"city\",\n" + "\"data_type\": \"TEXT\",\n" + "\"cardinality\": \"SINGLE\",\n" + "\"check_exist\": false,\n" + "\"properties\":[]\n" - + "}"); + + "}", 202); createAndAssert(path, "{\n" + "\"name\": \"lang\",\n" + "\"data_type\": \"TEXT\",\n" + "\"cardinality\": \"SINGLE\",\n" + "\"check_exist\": false,\n" + "\"properties\":[]\n" - + "}"); + + "}", 202); createAndAssert(path, "{\n" + "\"name\": \"date\",\n" + "\"data_type\": \"TEXT\",\n" + "\"cardinality\": \"SINGLE\",\n" + "\"check_exist\": false,\n" + "\"properties\":[]\n" - + "}"); + + "}", 202); createAndAssert(path, "{\n" + "\"name\": \"price\",\n" + "\"data_type\": \"INT\",\n" + "\"cardinality\": \"SINGLE\",\n" + "\"check_exist\": false,\n" + "\"properties\":[]\n" - + "}"); + + "}", 202); createAndAssert(path, "{\n" + "\"name\": \"weight\",\n" + "\"data_type\": \"DOUBLE\",\n" + "\"cardinality\": \"SINGLE\",\n" + "\"check_exist\": false,\n" + "\"properties\":[]\n" - + "}"); + + "}", 202); } protected static void initVertexLabel() { @@ -427,8 +427,13 @@ protected static void initVertex() { } protected static Response createAndAssert(String path, String body) { + return createAndAssert(path, body, 201); + } + + protected static Response createAndAssert(String path, String body, + int status) { Response r = client.post(path, body); - assertResponseStatus(201, r); + assertResponseStatus(status, r); return r; } diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/GremlinApiTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/GremlinApiTest.java index ee18ddb2b9..c983ca1134 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/GremlinApiTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/GremlinApiTest.java @@ -127,7 +127,7 @@ public void testSetVertexProperty() { + "\"cardinality\": \"SINGLE\"," + "\"properties\":[]" + "}"; - assertResponseStatus(201, client().post(pkPath, foo)); + assertResponseStatus(202, client().post(pkPath, foo)); // Cardinality list String bar = "{" + "\"name\": \"bar\"," @@ -135,7 +135,7 @@ public void testSetVertexProperty() { + "\"cardinality\": \"LIST\"," + "\"properties\":[]" + "}"; - assertResponseStatus(201, client().post(pkPath, bar)); + assertResponseStatus(202, client().post(pkPath, bar)); String vlPath = "/graphs/hugegraph/schema/vertexlabels/"; String vertexLabel = "{" diff --git a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/PropertyKeyApiTest.java b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/PropertyKeyApiTest.java index 6137b6f034..4eff83ee43 100644 --- a/hugegraph-test/src/main/java/com/baidu/hugegraph/api/PropertyKeyApiTest.java +++ b/hugegraph-test/src/main/java/com/baidu/hugegraph/api/PropertyKeyApiTest.java @@ -38,7 +38,7 @@ public void testCreate() { + "\"properties\":[]" + "}"; Response r = client().post(path, propertyKey); - assertResponseStatus(201, r); + assertResponseStatus(202, r); } @Test @@ -50,7 +50,7 @@ public void testGet() { + "\"properties\":[]" + "}"; Response r = client().post(path, propertyKey); - assertResponseStatus(201, r); + assertResponseStatus(202, r); String name = "id"; r = client().get(path, name); @@ -66,7 +66,7 @@ public void testList() { + "\"properties\":[]" + "}"; Response r = client().post(path, propertyKey); - assertResponseStatus(201, r); + assertResponseStatus(202, r); r = client().get(path); assertResponseStatus(200, r); @@ -81,7 +81,7 @@ public void testDelete() { + "\"properties\":[]" + "}"; Response r = client().post(path, propertyKey); - assertResponseStatus(201, r); + assertResponseStatus(202, r); String name = "id"; r = client().delete(path, name);