Newer
Older
RestfulChecker / src / main / Main.java
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());
	}

	static private void init() {
		api.setAccount("https://www.googleapis.com/youtube/v3");
		queryParam.add(new RestParam("id", "PLZcOpFipzeuFmuPLYyijcN0l4S0skwuiR"));
		queryParam.add(new RestParam("part", "id"));
		api.setToken("access_token",
				"ya29.GltqBnBr5rboUfJ8ODUnj3vtdV54kjLRXbbntDt1M_4f_HGfXj-NL5ODfDkS7tn4nzP93L3w26KvtB27EZAg3Z7Q_NJZGNDy4KtKTTla1TNOA8URDNsKDEqHEV4D");
		pathParam.add("playlists");
		api.setProperty("Content-type", "application/json");
		api.setupRestTest(Method.GET, queryParam, formParam, pathParam);
	}

}