package com.miaxis.test;

import com.miaxis.HzgzptApplication;
import com.miaxis.test.Impl.TestServiceImpl;
import com.miaxis.common.sign.PlatUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.io.File;

@SpringBootTest(classes = HzgzptApplication.class)
@RunWith(SpringRunner.class)
public class NormalTest {

    public static String qgptHttpTopServerPath = "http://114.55.58.112:8085/top/";
    public static String qgptHttpServerPath = "http://115.29.171.186:8085/";
    public static final String file_stuimg = "stuimg";//学员头像
    /** 接口服务器:Imageup (文件资料信息上传) */
    public static final String httpServer_Imageup = "imageup";


    @Resource
    private TestServiceImpl testService;


    @Test
    public void test2() throws Exception {
        File file =new File("F:/doc/img/gen-view.jpg");
        System.out.println(testService.imageUpForQG(file,this.httpServer_Imageup,this.file_stuimg,""));
    }

    @Test
    public void test3() throws Exception {
        File file =new File("F:/doc/img/gen-view.jpg");
        testService.getHttpServerUrlForFileUpload(this.qgptHttpTopServerPath, httpServer_Imageup + "/" + file_stuimg, PlatUtil.getBytesFromFile(file), "");


//        System.out.println(testService.imageUpForQG(file,this.httpServer_Imageup,this.file_stuimg,""));
    }



}
