<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
package com.mos.quote;
import com.mos.quote.model.Area;
import com.mos.quote.service.IAreaService;
import org.junit.Assert;
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.annotation.Rollback;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest
public class QuoteApplicationTests {
@Autowired
private IAreaService areaService;
@Test
public void contextLoads() {
}
@Test
public void testUpdate(){
Area area = new Area();
area.setCode("001003");
area.setName("洛阳市");
Integer result = areaService.update(area);
Assert.assertEquals(1, (long)result);
}
@Test
@Transactional
@Rollback
public void testUpdate4Rollback(){
Area area = new Area();
area.setCode("001001");
area.setName("郑州市123");
Integer result = areaService.update(area);
Assert.assertEquals(1, (long)result);
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有