|
@@ -136,6 +136,20 @@ class FoodDeliveryPromotionQuoteServiceTest
|
|
|
assertEquals("promotion.freeDelivery.invalidProduct", badQuantity.getMessage());
|
|
assertEquals("promotion.freeDelivery.invalidProduct", badQuantity.getMessage());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void quote_shouldRejectUnapprovedFood()
|
|
|
|
|
+ {
|
|
|
|
|
+ // to_examine='0' 为待审核(菜单口径 '1' 才可售),必须拒绝
|
|
|
|
|
+ FoodDeliveryPromotionQuoteService spy = spyWithRoute(BigDecimal.valueOf(3000));
|
|
|
|
|
+ PosFood pending = food(STORE_ID, "50");
|
|
|
|
|
+ pending.setToExamine("0");
|
|
|
|
|
+ when(foods.selectById(FOOD_ID)).thenReturn(pending);
|
|
|
|
|
+
|
|
|
|
|
+ ServiceException rejected = assertThrows(ServiceException.class,
|
|
|
|
|
+ () -> spy.quote(request(), USER_ID));
|
|
|
|
|
+ assertEquals("promotion.freeDelivery.invalidProduct", rejected.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Test
|
|
@Test
|
|
|
void quote_shouldRejectUnknownOrderTypeOrMissingStore()
|
|
void quote_shouldRejectUnknownOrderTypeOrMissingStore()
|
|
|
{
|
|
{
|
|
@@ -321,7 +335,7 @@ class FoodDeliveryPromotionQuoteServiceTest
|
|
|
food.setPrice(new BigDecimal(price));
|
|
food.setPrice(new BigDecimal(price));
|
|
|
food.setName("测试商品");
|
|
food.setName("测试商品");
|
|
|
food.setStackingUp("0");
|
|
food.setStackingUp("0");
|
|
|
- food.setToExamine("0");
|
|
|
|
|
|
|
+ food.setToExamine("1");
|
|
|
return food;
|
|
return food;
|
|
|
}
|
|
}
|
|
|
|
|
|