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
-
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importServiceFields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetUp()voidTests promotion with voucher that has product restriction.voidPuts two products in the cart, applies one 10% product promotion, and redeems 1.voidMethods inherited from class de.hybris.platform.servicelayer.ServicelayerTest
createCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNoneMethods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSessionMethods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
Constructor Details
-
PromotionWithVoucherTest
public PromotionWithVoucherTest()
-
-
Method Details
-
setUp
- Overrides:
setUpin classAbstractPromotionServiceTest- Throws:
Exception
-
testUnsavedCartEntryVsJaloCalculate
- Throws:
JaloPriceFactoryException
-
testPromotionWithVoucher
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, JaloPriceFactoryExceptionTests 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
-