Newer
Older
RestfulChecker / src / main / Main.java
y-ota on 6 Dec 2018 1 KB ReadResourceを作成
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 TestGETCactus get = new TestGETCactus();
	static TestPOSTCactus post = new TestPOSTCactus("f", "f", "f");
	static TestPUTCactus put = new TestPUTCactus("f", "f");
	static TestDELETECactus delete = new TestDELETECactus("qF9bgKYZmw8P");

	public static void main(String[] args) {
		// post.start();
		init();
		api.jsonAcquisition("src/main/you.json");
		api.doRestTest();
		System.out.println(api.getResults());
		// System.out.println(api.getBeforeResults());
		// System.out.println(api.getJudgeResult());
	}

	static private void init() {
		api.setAccount("https://www.googleapis.com/youtube/v3");
		// queryParam.add(new RestParam("key",
		// "AIzaSyD5EI71SqPZhgdpwzlV0XTisGuKKtH5p6I"));
		// queryParam.add(new RestParam("id", "7lCDEYXw3mM"));
		queryParam.add(new RestParam("part", "snippet"));
		queryParam.add(new RestParam("access_token",
				"ya29.GltqBt15-zkpMQ_Moqbt1ccsFh-KFFKcWHNB9LiDYlAOBdOW-gqHCexRJUfJN-G2j_2W2GfNT1HrRC5b0N9sl7RYcmXb28-lHjbtu0mWP7PHU0FhzJ-MnymdbnVJ"));
		pathParam.add("playlists");
		api.setupRestTest(Method.POST, queryParam, formParam, pathParam);
	}

}