ReportTest.java 1.53 KB
package com.xkl.inneruse;

import com.xkl.Constants;
import com.xkl.HttpTools;
import org.junit.BeforeClass;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

import static com.xkl.TokenTest.loginAndGetToken;

/**
 * Created by win7 on 2016/12/26.
 * 报告相关
 */
public class ReportTest {
    private static final String URL_REPORT_LIST = Constants.URL_PREFIX + "/report/list";
    private static final String URL_REPORT_DETAIL = Constants.URL_PREFIX + "/report/detail";
    private static final String URL_REPORT_SCORE = Constants.URL_PREFIX + "/report/score";
    private static final String URL_ITEM_INFO = Constants.URL_PREFIX + "/report/itemInfo";
    private static final String URL_ITEM_GRAPH = Constants.URL_PREFIX + "/report/itemGraph";
    private static final String URL_COMPARE = Constants.URL_PREFIX + "/report/compare";
    private static String token;

    @BeforeClass
    public static void init(){
        token = loginAndGetToken("user1","pass1");
//        String token =OpenIdTest.bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0");
    }

    /**
     * 健康评分接口
     */
    @Test
    public void testScore(){
        Map<String,String> params = new HashMap<String, String>();
        params.put("report_id","77");
        params.put("t",HttpTools.getNow());
        params.put("type",Constants.KEY_ID);
        params.put("sign",HttpTools.getSign(params));
        String response = HttpTools.requestByMap(URL_REPORT_SCORE,"GET",params);
        System.out.println(response);
    }

}