Commit 6a63a7c0 by 周晓航

维护spock

parent 2a89242b
...@@ -204,7 +204,7 @@ class ShoppingCartNewDiscountSpock extends Specification { ...@@ -204,7 +204,7 @@ class ShoppingCartNewDiscountSpock extends Specification {
, ProductInfosDto.class) , ProductInfosDto.class)
// Shop/ValidateShopProduct // Shop/ValidateShopProduct
def valiadProductResponse = JSON.parseObject("{\"data\":{\"failureList\":[],\"successList\":[{\"code\":0,\"productType\":{\"additionalGroupList\":[],\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"businessNo\":\"\",\"category\":\"\",\"categoryName\":\"\",\"companyId\":\"2690\",\"customerCode\":\"isStockLimit001\",\"finalPrice\":106,\"foreignName\":\"\",\"isDishware\":0,\"isSkuProduct\":0,\"linkedId\":\"\",\"memberDiscount\":0,\"name\":\"迦勒套餐限制库存\",\"openMemberDiscount\":0,\"originalPrice\":100,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1666144031098.jpg\",\"pid\":\"255176569631514924\",\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCode\":\"123123123asdf\",\"productComboList\":[{\"customerCode\":\"jrb\",\"finalPrice\":33,\"foreignProductName\":\"\",\"linkedId\":\"\",\"originalPrice\":33,\"packPrice\":1,\"picture\":\"https://picture.sandload.cn/1628583566754.jpg\",\"productCode\":\"5566\",\"productId\":\"215806490097850416\",\"productName\":\"柚子的鸡肉棒\",\"productType\":1,\"quantity\":1,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0}],\"productGroupList\":[{\"allowRepeat\":1,\"groupCode\":\"迦勒套餐0021\",\"groupDetail\":[{\"customerCode\":\"jrb\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":33,\"picture\":\"https://picture.sandload.cn/1628583566754.jpg\",\"productCode\":\"5566\",\"productFinalPrice\":33,\"productId\":\"215806490097850416\",\"productName\":\"柚子的鸡肉棒\",\"productPrice\":33,\"productType\":1,\"stockLimit\":2,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0},{\"customerCode\":\"hb\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":2,\"picture\":\"https://picture.sandload.cn/1628583887266.png\",\"productCode\":\"445533\",\"productFinalPrice\":2,\"productId\":\"215806824348227645\",\"productName\":\"柚子的汉堡\",\"productPrice\":2,\"productType\":1,\"stockLimit\":2,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0},{\"customerCode\":\"gl\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":4,\"picture\":\"https://picture.sandload.cn/1628587383665.jpg\",\"productCode\":\"776655\",\"productFinalPrice\":40,\"productId\":\"215810517496862722\",\"productName\":\"柚子的果篮\",\"productPrice\":40,\"productType\":1,\"stockLimit\":1,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0}],\"linkId\":\"2690\",\"maxNumber\":5,\"minNumber\":3,\"must\":1,\"name\":\"迦勒商品租\",\"options\":\"\",\"pgid\":\"251946861712302120\",\"remark\":\"\",\"total\":0}],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1666144031098.jpg\"}],\"riseSell\":1,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"specification\":\"\",\"status\":2,\"stock\":50,\"stockLimit\":1,\"type\":7,\"unit\":\"\",\"weight\":0.0,\"weightType\":0},\"skuId\":\"255176569631514924\",\"spuId\":\"255176569631514924\",\"uuid\":\"e58094b9-412f-4c46-9278-1d81cd694fb5\"}]},\"errcode\":100,\"errmsg\":\"获取门店必选分类商品成功\"}" def valiadProductResponse = JSON.parseObject("{\"data\":{\"failureList\":[],\"successList\":[{\"code\":0,\"productType\":{\"additionalGroupList\":[],\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"businessNo\":\"\",\"category\":\"\",\"categoryName\":\"\",\"companyId\":\"2690\",\"customerCode\":\"isStockLimit001\",\"finalPrice\":106,\"foreignName\":\"\",\"isDishware\":0,\"isSkuProduct\":0,\"linkedId\":\"\",\"memberDiscount\":0,\"name\":\"迦勒套餐限制库存\",\"openMemberDiscount\":0,\"originalPrice\":100,\"stockMode\":2,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1666144031098.jpg\",\"pid\":\"255176569631514924\",\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCode\":\"123123123asdf\",\"productComboList\":[{\"customerCode\":\"jrb\",\"finalPrice\":33,\"foreignProductName\":\"\",\"linkedId\":\"\",\"originalPrice\":33,\"packPrice\":1,\"picture\":\"https://picture.sandload.cn/1628583566754.jpg\",\"productCode\":\"5566\",\"productId\":\"215806490097850416\",\"productName\":\"柚子的鸡肉棒\",\"productType\":1,\"quantity\":1,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0}],\"productGroupList\":[{\"allowRepeat\":1,\"groupCode\":\"迦勒套餐0021\",\"groupDetail\":[{\"customerCode\":\"jrb\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":33,\"picture\":\"https://picture.sandload.cn/1628583566754.jpg\",\"productCode\":\"5566\",\"productFinalPrice\":33,\"productId\":\"215806490097850416\",\"productName\":\"柚子的鸡肉棒\",\"productPrice\":33,\"productType\":1,\"stockLimit\":2,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0},{\"customerCode\":\"hb\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":2,\"picture\":\"https://picture.sandload.cn/1628583887266.png\",\"productCode\":\"445533\",\"productFinalPrice\":2,\"productId\":\"215806824348227645\",\"productName\":\"柚子的汉堡\",\"productPrice\":2,\"productType\":1,\"stockLimit\":2,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0},{\"customerCode\":\"gl\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":4,\"picture\":\"https://picture.sandload.cn/1628587383665.jpg\",\"productCode\":\"776655\",\"productFinalPrice\":40,\"productId\":\"215810517496862722\",\"productName\":\"柚子的果篮\",\"productPrice\":40,\"productType\":1,\"stockLimit\":1,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0}],\"linkId\":\"2690\",\"maxNumber\":5,\"minNumber\":3,\"must\":1,\"name\":\"迦勒商品租\",\"options\":\"\",\"pgid\":\"251946861712302120\",\"remark\":\"\",\"total\":0}],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1666144031098.jpg\"}],\"riseSell\":1,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"specification\":\"\",\"status\":2,\"stock\":50,\"stockLimit\":1,\"type\":7,\"unit\":\"\",\"weight\":0.0,\"weightType\":0},\"skuId\":\"255176569631514924\",\"spuId\":\"255176569631514924\",\"uuid\":\"e58094b9-412f-4c46-9278-1d81cd694fb5\"}]},\"errcode\":100,\"errmsg\":\"获取门店必选分类商品成功\"}"
, new TypeReference<ProductBaseResponse<ValiadShopProductResponse>>() {}) , new TypeReference<ProductBaseResponse<ValiadShopProductResponse>>() {})
def activityQueryResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":[],\"statusCode\":\"100\",\"ver\":1}" def activityQueryResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":[],\"statusCode\":\"100\",\"ver\":1}"
......
...@@ -69,6 +69,10 @@ class ShoppingCartOldDiscountSpock extends Specification { ...@@ -69,6 +69,10 @@ class ShoppingCartOldDiscountSpock extends Specification {
def buyAndGiftsPromotionService = new BuyAndGiftsPromotionService() def buyAndGiftsPromotionService = new BuyAndGiftsPromotionService()
def materialPromotionService = new MaterialPromotionService() def materialPromotionService = new MaterialPromotionService()
def fullPromotionService = new FullPromotionService() def fullPromotionService = new FullPromotionService()
def memberDiscountService = new MemberDiscountServiceImpl()
def fullMCountNFoldService = new FullMCountNFoldPromotionService()
def buyMSendNCouponDiscountService = new BuyMSendNCouponDiscountServiceImpl()
def memberDiscountServiceNew = new MemberDiscountServiceImpl()
def sharingCartService = new CalculationSharingCartService() def sharingCartService = new CalculationSharingCartService()
...@@ -204,6 +208,10 @@ class ShoppingCartOldDiscountSpock extends Specification { ...@@ -204,6 +208,10 @@ class ShoppingCartOldDiscountSpock extends Specification {
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_GIFTS)).thenReturn(buyAndGiftsPromotionService) PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_GIFTS)).thenReturn(buyAndGiftsPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.Material)).thenReturn(materialPromotionService) PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.Material)).thenReturn(materialPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.FULL_REDUCTION)).thenReturn(fullPromotionService) PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.FULL_REDUCTION)).thenReturn(fullPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.MEMBER_DISCOUNT)).thenReturn(memberDiscountService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.FULL_M_COUNT_N_FOLD)).thenReturn(fullMCountNFoldService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.MEMBER_DISCOUNT_NEw)).thenReturn(memberDiscountServiceNew)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_M_SEND_N_COUPON)).thenReturn(buyMSendNCouponDiscountService)
when: "调用方法逻辑" when: "调用方法逻辑"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment