Class ProductMultiBuyPromotionTest

All Implemented Interfaces:
JaloSessionHolder

public class ProductMultiBuyPromotionTest extends AbstractPromotionTest
Test for ProductMultiBuyPromotion.
  • Constructor Details

    • ProductMultiBuyPromotionTest

      public ProductMultiBuyPromotionTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      Overrides:
      setUp in class AbstractPromotionTest
      Throws:
      Exception
    • testProductMultiBuyPromotion

      public void testProductMultiBuyPromotion() throws CalculationException
      HW1210-3411: 253.0 Euro, HW1100-0023: 523.99 Euro, and HW2310-1001: 29.90 Euro. The ProductMultiBuyPromotion will be fired if at least 3 pieces of HW1210-3411 and/or HW1100-0023 are in the cart for 900 Euro.
      • adds one piece of all those products in cart, and tests the total price,
      • adds one more HW1210-3411 and HW1100-0023 in cart, and tests the total price again,
      • updates with the ProductMultiBuyPromotion, and checks the total price,
      • in ProductMultiBuyPromotion, the product with lowest price will be first consumed,
      • so two HW1210-3411 and one HW1100-0023 are valid for the ProductMultiBuyPromotion under this situation,
      • checks the total price: 900 + 523.99 + 29.90 = 1453.89.
      Throws:
      CalculationException