Newer
Older
RestfulChecker / src / main / Main.java
y-ota on 13 Dec 2018 2 KB 404は通すように・・・
package main;

import java.util.ArrayList;

import restfulchecker.*;
import restfulchecker.RestChecker.Method;
import testcase.*;

public class Main {
	static RestChecker api = new RestChecker();
	static ArrayList<RestParam> queryParam = new ArrayList<>();
	static ArrayList<RestParam> formParam = new ArrayList<>();
	static ArrayList<String> pathParam = new ArrayList<>();
	static NecessaryParam nes = new NecessaryParam();
	static RemoveJsonParam remove = new RemoveJsonParam();
	static final String token = "ya29.GltxBrlNG1CnuccnM6c8-uSBKv9gvVsDjq4jbaNduxRaN9ei8CXYGTzEoVNV-gnAKqiLpL9WxJIZ_Jy6KT7oQKLbHbBiRzaXdHXBrZEm-xWX_EAM_-G2-NIlDz3G";

	public static void main(String[] args) {
		TestCactus get = new TestGETCactus();
		TestCactus post = new TestCreatePOSTCactus("f", "f", "f");
		TestCactus logout = new TestLogoutPOSTCactus(
				"h41ZoL44toLq3Kg7B1aXreHjcjluAsoyz8DezqiXJ28s1atiGR5UHFOqi7Or3xOD");
		TestCactus put = new TestPUTCactus("f", "f");
		TestCactus delete = new TestDELETECactus("qF9bgKYZmw8P");
		TestYouTube list = new TestGETYouTube(token);
		TestYouTube insert = new TestPOSTYouTube(token);
		TestYouTube update = new TestPUTYouTube(token);
		TestYouTube deletelist = new TestDELETEYouTube(token, "PLCwNa5MZdBSq_3K5-MV0x6luKXskvqrKk");
		deletelist.start();
//		init();
//		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\"}}]",
//				remove));
//		api.doRestTest();
//		System.out.println(api.getResults());
	}

	private static void init() {
		api.setAccount("https://www.googleapis.com/youtube/v3");
		queryParam.add(new RestParam("mine", "true"));
		queryParam.add(new RestParam("part", "id"));
		queryParam.add(new RestParam("access_token",
				"ya29.GltxBj_5n_s4vQREqFTthpK2VzHsHlWA2IM23VI-_Ba8c4gHe5a7WAPehjVE31mhuesxWnlNGWND2RAJ5zTz3-PlItqutga6rWOOivXYusklhHha0yavLB2Ms0vV"));
		pathParam.add("playlists");
		api.getGetnesParam().setQueryParams(new RestParam("mine", "true"));
		api.getGetnesParam().setQueryParams(new RestParam("part", "id"));
		api.getGetnesParam().setQueryParams(new RestParam("access_token",
				"ya29.GltxBj_5n_s4vQREqFTthpK2VzHsHlWA2IM23VI-_Ba8c4gHe5a7WAPehjVE31mhuesxWnlNGWND2RAJ5zTz3-PlItqutga6rWOOivXYusklhHha0yavLB2Ms0vV"));
		api.getGetnesParam().setPathParams("playlists");
		api.setProperty("Content-type", "application/json");
		api.setRemoveParam(new RemoveJsonParam("etag", new ArrayList<>()));
		api.setupRestTest(Method.GET, queryParam, formParam, pathParam);
		remove.setRemoveParam("privacyStatus");
		remove.setNode("status");
	}

}