单元测试
This commit is contained in:
parent
ee9539f124
commit
73e242a4a1
@ -30,6 +30,22 @@
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 测试 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>1
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
|
32
ktg-admin/src/test/test.java
Normal file
32
ktg-admin/src/test/test.java
Normal file
@ -0,0 +1,32 @@
|
||||
import com.ktg.RuoYiApplication;
|
||||
import com.ktg.mes.qc.domain.InventoryTask;
|
||||
import com.ktg.mes.qc.service.InventoryTaskService;
|
||||
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;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = RuoYiApplication.class)
|
||||
public class test {
|
||||
@Autowired
|
||||
private InventoryTaskService inventoryTaskService;
|
||||
@Test
|
||||
public void saveTest(){
|
||||
//新建任务对象
|
||||
InventoryTask inventoryTaskTest = new InventoryTask();
|
||||
inventoryTaskTest.setWmsInventoryCode("TEST001");
|
||||
inventoryTaskTest.setUomId("TEST001");
|
||||
inventoryTaskTest.setName("测试计划");
|
||||
inventoryTaskTest.setPlanPeriod("月");
|
||||
inventoryTaskTest.setStartTime("2022-01-01");
|
||||
inventoryTaskTest.setFinishTime("2022-12-31");
|
||||
inventoryTaskTest.setSuperiorTime("2022-01-01");
|
||||
inventoryTaskTest.setBelowTime("2022-12-31");
|
||||
inventoryTaskTest.setProductId("TEST001");
|
||||
//新增
|
||||
int i = inventoryTaskService.insertInventoryTask(inventoryTaskTest);
|
||||
|
||||
}
|
||||
}
|
@ -21,6 +21,21 @@
|
||||
<artifactId>jasperreports</artifactId>
|
||||
<version>6.18.1</version>
|
||||
</dependency>
|
||||
<!-- 测试 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sf.jasperreports</groupId>
|
||||
<artifactId>jasperreports-fonts</artifactId>
|
||||
|
15
pom.xml
15
pom.xml
@ -122,6 +122,21 @@
|
||||
<version>${commons.fileupload.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 测试 -->
|
||||
<!-- 测试 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
|
Loading…
Reference in New Issue
Block a user