import com.iamberry.wechat.tools.WxPayUtil;
import nl.bitwalker.useragentutils.Browser;
import nl.bitwalker.useragentutils.OperatingSystem;
import nl.bitwalker.useragentutils.UserAgent;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.IOException;

/**
 * @author 献
 * @company Goochine-深圳古辰创智科技有限公司
 * @website www.goochine.com
 * @tel 18271840547
 * @date 2017/4/25
 */
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations="classpath:iamberry-wechat-web-ioc.xml")
public class TestClassPath {
//    public static void main(String[] args) throws IOException {
//        UserAgent userAgent = UserAgent.parseUserAgentString("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36");
//        Browser browser = userAgent.getBrowser();
//        OperatingSystem os = userAgent.getOperatingSystem();
//        System.out.println(browser.getName());
//        System.out.println(os.getDeviceType().getName());
//        System.out.println(os.getName());
//        System.out.println(os.isMobileDevice());
//
//        String productInfo = "{\"resultCode\":200,\"resultMsg\":\"SUCCESS\", \"returnCode\":200, " +
//                "\"product_info\":{\"productName\":\"美国进口watero净饮水一体机\", " +
//                "\"colors\":[" +
//                "{\"colorName\":\"红色\",\"colorPic\":\"color_pic_1\"}," +
//                "{\"colorName\":\"绿色\",\"colorPic\":\"color_pic_2\"}," +
//                "{\"colorName\":\"蓝色\",\"colorPic\":\"color_pic_2\"}" +
//                "]" +
//                ",\"productPrcie\":368000, \"subPrcie\":900}," +
//                "\"packages\":[" +
//                "{\"name\":\"套餐一\",\"auth\":\"两年使用权\",\"info\":\"包两年滤芯\", \"prcie\":169000, \"gives\":" +
//                "[{\"giveName\":\"杯子\",\"givePic\":\"gife_pic1\"},{\"giveName\":\"铁锅\",\"givePic\":\"gife_pic1\"}]" +
//                "}," +
//                "{\"name\":\"套餐一\",\"auth\":\"两年使用权\",\"info\":\"包两年滤芯\", \"prcie\":169000, \"gives\":" +
//                "[{\"giveName\":\"杯子\",\"givePic\":\"gife_pic1\"},{\"giveName\":\"铁锅\",\"givePic\":\"gife_pic1\"}]" +
//                "}" +
//                "]" +
//                "}";
//        System.out.println(productInfo);
//    }
//    @Test
//    public void testReOrder() {
//        System.out.println(WxPayUtil.refund("abc", "aaaaaaa", "aaaaaaaa", 100, 100));
//    }

//    public void testBrowser() {
//        UserAgent userAgent = UserAgent.parseUserAgentString("");
//        Browser browser = userAgent.getBrowser();
//        OperatingSystem os = userAgent.getOperatingSystem();
//        System.out.println(browser);
//    }
}
