diff --git a/document/transelete.docx b/document/transelete.docx index 574e404..2737144 100644 --- a/document/transelete.docx +++ b/document/transelete.docx Binary files differ diff --git a/src/main/Main.java b/src/main/Main.java index 8b5b187..c246b09 100644 --- a/src/main/Main.java +++ b/src/main/Main.java @@ -23,8 +23,8 @@ public static void main(String[] args) { // logout.start(); init(); - api.jsonAcquisition("src/main/you.json"); - System.out.println(api.getReadJson()); +// api.jsonAcquisition("src/main/you.json"); +// System.out.println(api.getReadJson()); System.out.println(api.jsonRemove( "[{\"snippet\":{\"title\":\"aaa\",\"status\":\"e\"}},{\"snippet\":{\"title\":\"aaa\",\"status\":\"e\"}}]", remove)); @@ -47,7 +47,7 @@ // api.setProperty("Content-type", "application/json"); api.setRemoveParam(new RemoveJsonParam("etag", new ArrayList<>())); api.setupRestTest(Method.GET, queryParam, formParam, pathParam); - remove.setRemoveParam("title"); + remove.setRemoveParam("status"); remove.setNode("snippet"); } diff --git a/src/main/you.json b/src/main/you.json index f6f8f1b..963bb02 100644 --- a/src/main/you.json +++ b/src/main/you.json @@ -1,6 +1,6 @@ { "snippet" : { "title" : "aaa", - "status" : "e" + "description" : "RestfulChecker`s Test" } } \ No newline at end of file diff --git a/src/restfulchecker/RestChecker.java b/src/restfulchecker/RestChecker.java index a29385d..db669a2 100644 --- a/src/restfulchecker/RestChecker.java +++ b/src/restfulchecker/RestChecker.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import com.fasterxml.jackson.databind.node.TextNode; public class RestChecker { private ArrayList accounts = new ArrayList<>(); @@ -201,38 +200,6 @@ } } - public String jsonRemove(String JsonString, String fieldName) { - try { - JsonNode json = new ObjectMapper().readTree(JsonString); - if (json.getClass() != ObjectNode.class) { - for (JsonNode js : json) { - if (js.getClass() == TextNode.class) { - - } else if (js.getClass() == ArrayNode.class) { - - } else { - ObjectNode obj = (ObjectNode) js; - obj.remove(fieldName); - } - } - } else { - ObjectNode obj = (ObjectNode) json; - obj.remove(fieldName); - } - return json.toString(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - } - - public String jsonRemove(JsonNode Json, String fieldName) { - ObjectNode obj = (ObjectNode) Json; - obj.remove(fieldName); - return obj.toString(); - } - public String jsonRemove(String JsonString, RemoveJsonParam param) { try { JsonNode json = new ObjectMapper().readTree(JsonString);