package com.iailab.sdk.demo;
|
|
import com.alibaba.fastjson.JSONObject;
|
import com.iailab.sdk.auth.client.common.pojo.CommonResult;
|
import org.junit.Test;
|
import org.junit.runner.RunWith;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import java.util.Map;
|
|
|
@RunWith(SpringRunner.class)
|
@SpringBootTest
|
public class HttpClientDemoTest{
|
|
@Autowired
|
private HttpClientDemo httpClientDemo;
|
|
|
/*@Test
|
public void authenticate() {
|
httpClientDemo.authenticate();
|
}
|
|
@Test
|
public void refreshToken() throws Exception {
|
httpClientDemo.refreshToken();
|
}
|
|
@Test
|
public void testQueryPlanChart() throws Exception {
|
Map<String, Object> stringObjectMap = httpClientDemo.queryPlanChart();
|
System.out.println(stringObjectMap);
|
}
|
|
@Test
|
public void testQueryPointsRealValue() throws Exception {
|
Map<String, Object> stringObjectMap = httpClientDemo.queryPointsRealValue();
|
System.out.println(stringObjectMap);
|
}
|
|
@Test
|
public void testDoHttpPost() throws Exception {
|
// 准备参数
|
httpClientDemo.doHttpPost();
|
}
|
|
@Test
|
public void testDoHttpGet() throws Exception {
|
// 准备参数
|
httpClientDemo.doHttpGet();
|
}*/
|
|
@Test
|
public void testDoHttpGet() throws Exception {
|
// 准备参数
|
List<String> params = new ArrayList<String>();
|
params.add("M0000101153");
|
CommonResult<Map<String, Object>> mapCommonResult = httpClientDemo.queryPointsRealValue(params);
|
System.out.println(JSONObject.toJSONString(mapCommonResult));
|
}
|
}
|