HasReportTest.java 998 Bytes
package com.xkl.internal;

import com.xkl.Constants;
import com.xkl.HttpTools;
import com.xkl.RtnCodeTools;
import com.xkl.partner.TokenTest;
import org.junit.Assert;
import org.junit.Test;

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

/**
 * zhaoyue 2017-05-13
 */
public class HasReportTest {
    private static final String URL_HAS_REPORT = Constants.URL_PREFIX + "/hasReport";

    @Test
    public void testHasReport() {
        Map<String, String> params = new HashMap<String, String>();
        params.put("username", Constants.USR_ACC);
        params.put("t", HttpTools.getNow());
        params.put("type", Constants.KEY_ID);
        params.put("sign", HttpTools.getSign(params));
        String response = HttpTools.requestByMap(URL_HAS_REPORT, "GET", params);
        System.out.println(response);
        // RtnCodeTools.verifyCode(response, 11400) ||
        // 返回11401有报告,11400没有报告
        Assert.assertTrue(RtnCodeTools.verifyCode(response, 11401));
    }
}