Package de.hybris.platform.promotions
Class PromotionUserRestrictionTest
- 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.PromotionUserRestrictionTest
-
- All Implemented Interfaces:
JaloSessionHolder
public class PromotionUserRestrictionTest extends ServicelayerTransactionalTest
Test the PromotionUserRestriction.
-
-
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 PromotionUserRestrictionTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
void
testPromotionUserRestriction()
Tests the user restriction under different circumstances.-
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
- Throws:
java.lang.Exception
-
testPromotionUserRestriction
public void testPromotionUserRestriction() throws CalculationException
Tests the user restriction under different circumstances.- background:
- demo is in customergroup,
- employee01 is in group11 that belongs to group01,
- besides, employee01 is in group12 that belongs to group05,
- employee02 is in group02,
- tests start:
- case 1
- promotion is fired for demo because he is in customergroup,
- case 2
- promotion is fired for employee01 because of the group hierarchy(group11-->group01),
- promotion is NOT fired for employee02 because he is not in group01,
- case 3
- promotion is fired for demo because he is exactly the user,
- case 4
- promotion is NOT fired for employee01 because he is not in group02,
- promotion is fired for employee02 because he is in group02,
- case 5
- promotion is fired for employee01 because of the group hierarchy(group12-->group05),
- promotion is NOT fired for employee02 because he is not in group05.
- Throws:
CalculationException
-
-