Files
CN_Gather/entrance/src/test/java/com/njcn/BaseJunitTest.java

47 lines
1.3 KiB
Java
Raw Normal View History

2025-04-11 11:03:16 +08:00
package com.njcn;
import com.njcn.gather.EntranceApplication;
import com.njcn.gather.report.pojo.DevReportParam;
import com.njcn.gather.report.service.IPqReportService;
2025-06-18 17:53:09 +08:00
import com.njcn.http.util.RestTemplateUtil;
2025-04-11 11:03:16 +08:00
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
2025-06-18 17:53:09 +08:00
import org.springframework.http.ResponseEntity;
2025-04-11 11:03:16 +08:00
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
2025-06-18 17:53:09 +08:00
import java.io.File;
import java.util.HashMap;
2025-04-11 11:03:16 +08:00
/**
* @author hongawen
* @version 1.0.0
* @date 2021年12月10日 15:05
*/
@RunWith(SpringRunner.class)
@WebAppConfiguration
@SpringBootTest(classes = EntranceApplication.class)
public class BaseJunitTest {
@Autowired
private IPqReportService pqReportService;
2025-06-18 17:53:09 +08:00
@Autowired
private RestTemplateUtil restTemplateUtil;
2025-04-11 11:03:16 +08:00
@Test
public void test() {
2025-06-18 17:53:09 +08:00
File file = new File("D:\\report\\PQS_882B4\\5555.docx");
try{
ResponseEntity<String> stringResponseEntity = restTemplateUtil.uploadFile("http://localhost:18082/api/file/upload",file);
}catch (Exception runtimeException){
System.out.println(runtimeException.getMessage());
}
2025-04-11 11:03:16 +08:00
}
}