public class ShopServiceTest extends BaseTest{
@Autowired
private ShopService shopService;
@Test
public void testAddShop() {
Shop shop = new Shop();
PersonInfo owner = new PersonInfo();
Area area = new Area();
ShopCategory shopCategory = new ShopCategory();
owner.setUserId(1L);
area.setAreaId(2);
shopCategory.setShopCategoryId(1L);
shop.setOwner(owner);
shop.setArea(area);
shop.setShopCategory(shopCategory);
shop.setShopName("测试的店铺1");
//测试店铺简介
shop.setShopDesc("test");
//测试店铺地址
shop.setShopAddr("test");
//测试店铺号码
shop.setPhone("test");
//测试创建时间
shop.setCreateTime(new Date());
//测试状态 1表示可用
shop.setEnableStatus(ShopStateEnum.CHECK.getState());
//测试超级管理员给店家的提醒,包括为什么审核不通过等
shop.setAdvice("审核中...");
File shopImg = new File("D://image//1.jpg");
ShopExecution se = shopService.addShop(shop, shopImg);
assertEquals(ShopStateEnum.CHECK.getState(),se.getState());
}
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程