Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
6a63a7c0
Commit
6a63a7c0
authored
Oct 28, 2022
by
周晓航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
维护spock
parent
2a89242b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
shopping-cart-application-service/src/test/spock/cn/freemud/service/impl/ShoppingCartNewDiscountSpock.groovy
+1
-1
shopping-cart-application-service/src/test/spock/cn/freemud/service/impl/ShoppingCartOldDiscountSpock.groovy
+8
-0
No files found.
shopping-cart-application-service/src/test/spock/cn/freemud/service/impl/ShoppingCartNewDiscountSpock.groovy
View file @
6a63a7c0
...
@@ -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}"
...
...
shopping-cart-application-service/src/test/spock/cn/freemud/service/impl/ShoppingCartOldDiscountSpock.groovy
View file @
6a63a7c0
...
@@ -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:
"调用方法逻辑"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment