Newer
Older
RestfulChecker / src / main / Main.java
y-ota on 3 Dec 2018 1 KB testcaseを作成
package main;

import java.util.ArrayList;

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


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 String code;

	public static void main(String[] args) {
		init();
		api.setupRestTest(Method.POST, queryParam, formParam, pathParam);
		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");
		api.setAccount("http://nitta-lab-www.is.konan-u.ac.jp/CactusServer/rest/accounts");
		formParam.add(new RestParam("userID", "test"));
		formParam.add(new RestParam("userPass", "test"));
		formParam.add(new RestParam("userName", "g"));
		queryParam.add(new RestParam("key", "AIzaSyD5EI71SqPZhgdpwzlV0XTisGuKKtH5p6I"));
		queryParam.add(new RestParam("id", "7lCDEYXw3mM"));
		queryParam.add(new RestParam("part", "status"));
		queryParam.add(new RestParam("access_token",
				"4/qAArj0H6c6w-brTnYiy1aGXn_PW97ks_KJdS03-tYEdXyT_W1OAyWh3OdMTuOctD1zEdjLpAHR2Ez-vgar6WqYQ"));
		pathParam.add("playlists");
		formParam.add(new RestParam("snippet.title", "test"));
		code = "4/qAArj0H6c6w-brTnYiy1aGXn_PW97ks_KJdS03-tYEdXyT_W1OAyWh3OdMTuOctD1zEdjLpAHR2Ez-vgar6WqYQ";
		formParam.add(new RestParam("Authorization",
				"4/pADWrNNy90AsgAfPqcxB_S4Js8ClNi_gRuvzb--4XvK_lCFfEBfP5t5mPODPASxUX1vjvrISNfKvgu1vR3Ev7do"));
		pathParam.add("logout");
		formParam.add(new RestParam("token", "E12xg9f1MCDr8P7aqDQdx4l7nIM3CdvpzXz2vbmzl832LGe8DjwAPWR6wZzP5hn4"));
		pathParam.add("G90zOL9UTeTx");
	}

}