mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-13 01:31:53 +08:00
mall:code review 商品 spu 的后端代码
This commit is contained in:
@@ -41,7 +41,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest {
|
||||
ProductSpuCreateReqVO reqVO = randomPojo(ProductSpuCreateReqVO.class);
|
||||
|
||||
// 调用
|
||||
Long spuId = spuService.createSpu(reqVO);
|
||||
Long spuId = spuService.createProductSpu(reqVO);
|
||||
// 断言
|
||||
assertNotNull(spuId);
|
||||
// 校验记录的属性是否正确
|
||||
@@ -60,7 +60,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest {
|
||||
});
|
||||
|
||||
// 调用
|
||||
spuService.updateSpu(reqVO);
|
||||
spuService.updateProductSpu(reqVO);
|
||||
// 校验是否更新正确
|
||||
ProductSpuDO spu = ProductSpuMapper.selectById(reqVO.getId()); // 获取最新的
|
||||
assertPojoEquals(reqVO, spu);
|
||||
@@ -72,7 +72,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest {
|
||||
ProductSpuUpdateReqVO reqVO = randomPojo(ProductSpuUpdateReqVO.class);
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> spuService.updateSpu(reqVO), SPU_NOT_EXISTS);
|
||||
assertServiceException(() -> spuService.updateProductSpu(reqVO), SPU_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user