parent
b8a7bde452
commit
733d41578c
@ -0,0 +1,54 @@
|
||||
package test.cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
|
||||
|
||||
import cn.estsh.i3plus.core.api.iservice.busi.ISysToolService;
|
||||
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase;
|
||||
import cn.estsh.i3plus.pojo.platform.bean.SysTool;
|
||||
import cn.estsh.i3plus.pojo.platform.repository.SysToolRepository;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
/**
|
||||
* @Description :
|
||||
* @Reference :
|
||||
* @Author : yunhao
|
||||
* @CreateDate : 2019-04-04 16:53
|
||||
* @Modify:
|
||||
**/
|
||||
public class TestAutoFillData extends TestBase {
|
||||
|
||||
@Autowired
|
||||
private ISysToolService sysToolService;
|
||||
|
||||
@Autowired
|
||||
private SysToolRepository sysToolRepository;
|
||||
|
||||
@Test
|
||||
@Transient
|
||||
public void testAutoFillDataInsert(){
|
||||
SysTool sysTool = new SysTool();
|
||||
// 自动注入默认值
|
||||
System.out.println(JSON.toJSONString(sysTool));
|
||||
sysTool = sysToolService.insertTestSysTool(sysTool, true);
|
||||
System.out.println(JSON.toJSONString(sysTool));
|
||||
|
||||
// 不注入默认值
|
||||
sysTool = new SysTool();
|
||||
System.out.println(JSON.toJSONString(sysTool));
|
||||
sysTool = sysToolService.insertTestSysTool(sysTool, false);
|
||||
System.out.println(JSON.toJSONString(sysTool));
|
||||
|
||||
// 默认insert不显示设置
|
||||
sysTool = new SysTool();
|
||||
System.out.println(JSON.toJSONString(sysTool));
|
||||
sysTool = sysToolService.insertTestSysTool(sysTool,null);
|
||||
System.out.println(JSON.toJSONString(sysTool));
|
||||
}
|
||||
|
||||
public void testAutoFilDataSave(){
|
||||
SysTool sysTool = new SysTool();
|
||||
sysToolService.saveSysTool(sysTool);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue