Package de.hybris.platform.promotions
Class PromotionWithVoucherTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.servicelayer.ServicelayerTransactionalTest
-
- de.hybris.platform.promotions.AbstractPromotionServiceTest
-
- de.hybris.platform.promotions.PromotionWithVoucherTest
-
- All Implemented Interfaces:
JaloSessionHolder
public class PromotionWithVoucherTest extends AbstractPromotionServiceTest
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importService
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description PromotionWithVoucherTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
void
testPromotionWithProductRestrictionVoucher()
Tests promotion with voucher that has product restriction.void
testPromotionWithVoucher()
Puts two products in the cart, applies one 10% product promotion, and redeems 1.void
testUnsavedCartEntryVsJaloCalculate()
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerTest
createCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNone
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception
- Overrides:
setUp
in classAbstractPromotionServiceTest
- Throws:
java.lang.Exception
-
testUnsavedCartEntryVsJaloCalculate
public void testUnsavedCartEntryVsJaloCalculate() throws JaloPriceFactoryException
- Throws:
JaloPriceFactoryException
-
testPromotionWithVoucher
public void testPromotionWithVoucher() throws JaloPriceFactoryException
Puts two products in the cart, applies one 10% product promotion, and redeems- 1. one voucher without free shipping or
- 2. one voucher with free shipping or
- 3. two vouchers, one with free shipping and the other one without.
- Throws:
JaloPriceFactoryException
-
testPromotionWithProductRestrictionVoucher
public void testPromotionWithProductRestrictionVoucher() throws CalculationException, JaloPriceFactoryException
Tests promotion with voucher that has product restriction. (currency is Euro)- product(HW1230-0001) price = 769.00 --> 2x = 1538.00
- product(HW2110-0012) price = 81.08 --> 2x = 162.16
- so the cart contains products that cost 1700.16 Euro without promotion/voucher.
- redeems the voucher that is 10% discount with product restriction: only valid for [HW1230-0001]
- applies the fixed price promotion that is only valid for [HW1230-0001], and the fixed price is 500
- update promotions, and the total discount should be (500 * 2) * 10% = 100
- total price of the cart: (500 * 2 + 81.08 * 2) - 100 = 1062.16
-
-