package cn.freemud.service;

import cn.freemud.utils.HttpUtil;
import com.google.common.collect.Maps;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Map;

@RunWith(SpringRunner.class)
@SpringBootTest
public class HttpClientTest {

    @Test
    public void httpClientDemo() {
        String url = "https://api.weixin.qq.com/sns/jscode2session";
        Map<String, Object> map = Maps.newTreeMap();
        map.put("appid", "wx99345514667d9c5f");
        map.put("secret", "cdeb9681ca74cbf680c9ad8df08cbb75");
        map.put("js_code", "sdfsdf");
        map.put("grant_type", "authorization_code");
        System.out.println("aaaaaa==" + HttpUtil.sendGetRequest(url, map, null));

    }

}
