Class PromotionGroupTest

    • Constructor Detail

      • PromotionGroupTest

        public PromotionGroupTest()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testProductPercentageDiscountPromotion

        public void testProductPercentageDiscountPromotion()
        Tests ProductPercentageDiscountPromotion
      • testProductSteppedMultiBuyPromotion

        public void testProductSteppedMultiBuyPromotion()
        Tests ProductSteppedMultiBuyPromotion
      • testMixedPromotions

        public void testMixedPromotions()
        Tests mixed promotion scenario: ProductSteppedMultiBuyPromotion + ProductPercentageDiscountPromotion. ProductSteppedMultiBuyPromotion has higher priority, ProductPercentageDiscountPromotion has lower priority. There are 5 items in the cart. First 4 are covered by ProductSteppedMultiBuyPromotion, because the definition of this promotion contains entries for 3 and 4 products - the latter one is taken. The remaining one product is covered by ProductPercentageDiscountPromotion. In the effect total price is composed of two parts: first part is the price for first 4 items, second part is the price for the last item. The first price is determined by the ProductSteppedMultiBuyPromotion promotion's steps definition (it does not depend on product price!), second price is determined by the unit price of the item and the promotion's defined percentage discount.