diff --git a/src/main/Main.java b/src/main/Main.java index c81ee61..31a8aa1 100644 --- a/src/main/Main.java +++ b/src/main/Main.java @@ -19,12 +19,13 @@ "h41ZoL44toLq3Kg7B1aXreHjcjluAsoyz8DezqiXJ28s1atiGR5UHFOqi7Or3xOD"); static TestCactus put = new TestPUTCactus("f", "f"); static TestCactus delete = new TestDELETECactus("qF9bgKYZmw8P"); - static TestYouTube list = new TestGETYouTube("ya29.GltxBj_5n_s4vQREqFTthpK2VzHsHlWA2IM23VI-_Ba8c4gHe5a7WAPehjVE31mhuesxWnlNGWND2RAJ5zTz3-PlItqutga6rWOOivXYusklhHha0yavLB2Ms0vV"); + static TestYouTube list = new TestGETYouTube( + "ya29.GltxBj_5n_s4vQREqFTthpK2VzHsHlWA2IM23VI-_Ba8c4gHe5a7WAPehjVE31mhuesxWnlNGWND2RAJ5zTz3-PlItqutga6rWOOivXYusklhHha0yavLB2Ms0vV"); public static void main(String[] args) { list.start(); // init(); -// api.jsonAcquisition("src/main/you.json"); +// api.jsonAcquisition("src/testcase/post.json"); // System.out.println(api.getReadJson()); // System.out.println(api.jsonRemove( // "[{\"snippet\":{\"title\":\"aaa\",\"description\":\"RestfulChecker`s Test\"},\"status\":{\"privacyStatus\":\"private\"}},{\"snippet\":{\"title\":\"aaa\",\"description\":\"RestfulChecker`s Test\"},\"status\":{\"privacyStatus\":\"private\"}}]", @@ -45,7 +46,7 @@ api.getGetnesParam().setQueryParams(new RestParam("access_token", "ya29.GltxBj_5n_s4vQREqFTthpK2VzHsHlWA2IM23VI-_Ba8c4gHe5a7WAPehjVE31mhuesxWnlNGWND2RAJ5zTz3-PlItqutga6rWOOivXYusklhHha0yavLB2Ms0vV")); api.getGetnesParam().setPathParams("playlists"); -// api.setProperty("Content-type", "application/json"); + api.setProperty("Content-type", "application/json"); api.setRemoveParam(new RemoveJsonParam("etag", new ArrayList<>())); api.setupRestTest(Method.GET, queryParam, formParam, pathParam); remove.setRemoveParam("privacyStatus"); diff --git a/src/main/you.json b/src/main/you.json deleted file mode 100644 index 87038dc..0000000 --- a/src/main/you.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "snippet": { - "title": "aaa", - "description": "RestfulChecker`s Test" - }, - "status": { - "privacyStatus": "private" - } -} \ No newline at end of file diff --git a/src/testcase/TestPOSTYouTube.java b/src/testcase/TestPOSTYouTube.java index c671804..3b1aa81 100644 --- a/src/testcase/TestPOSTYouTube.java +++ b/src/testcase/TestPOSTYouTube.java @@ -1,10 +1,20 @@ package testcase; +import restfulchecker.RestParam; +import restfulchecker.RestChecker.Method; + public class TestPOSTYouTube extends TestYouTube { protected TestPOSTYouTube(String token) { super(token); - // TODO Auto-generated constructor stub + check.jsonAcquisition("src/testcase/post.json"); + check.setProperty("Content-type", "application/json"); + check.getGetnesParam().setPathParams("playlists"); + check.getGetnesParam().setQueryParams(new RestParam("mine", "true")); + check.getGetnesParam().setQueryParams(new RestParam("part", "id")); + path.add("playlists"); + query.add(new RestParam("part", "snippet")); + check.setupRestTest(Method.POST, query, form, path); } } diff --git a/src/testcase/post.json b/src/testcase/post.json new file mode 100644 index 0000000..87038dc --- /dev/null +++ b/src/testcase/post.json @@ -0,0 +1,9 @@ +{ + "snippet": { + "title": "aaa", + "description": "RestfulChecker`s Test" + }, + "status": { + "privacyStatus": "private" + } +} \ No newline at end of file