Class DefaultSearchRestrictionServiceDemoTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.servicelayer.search.restriction.impl.DefaultSearchRestrictionServiceDemoTest
-
- All Implemented Interfaces:
JaloSessionHolder
@DemoTest public class DefaultSearchRestrictionServiceDemoTest extends ServicelayerTest
Tests demonstrating usage of the search restriction service.
-
-
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 DefaultSearchRestrictionServiceDemoTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckSearchRestrictionCreateAndGetSearchRestrictionsForType()Demonstrates how to check whether type has restrictions then create model based restrictions for some type and next obtain them from that type.voidclearSessionSearchRestriction()Demonstrates how to clear all registered session search restrictions.voidcreateAndAddSessionSearchRestriction()Demonstrates how to createSessionSearchRestrictionobject and add it to the session.voidenableAndDisableSearchRestriction()Demonstrates how enable and disable search restrictions (both - session and persistent model based restrictions).voidremoveSessionSearchRestriction()Demonstrates how to remove few session search restrictions from list of registered session search restrictions.voidsetUp()voidtearDown()-
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
-
tearDown
public void tearDown()
-
createAndAddSessionSearchRestriction
public void createAndAddSessionSearchRestriction()
Demonstrates how to createSessionSearchRestrictionobject and add it to the session.Test scenario:
- prepare
SessionSearchRestrictionobject
- add session search restriction with usage ofSearchRestrictionService#addSessionSearchRestrictions(java.util.Collection)method
-
clearSessionSearchRestriction
public void clearSessionSearchRestriction()
Demonstrates how to clear all registered session search restrictions.Test scenario:
- prepare
SessionSearchRestrictionobject
- add session search restriction with usage ofSearchRestrictionService#addSessionSearchRestrictions(java.util.Collection)method
- clear session search restrictions
-
removeSessionSearchRestriction
public void removeSessionSearchRestriction()
Demonstrates how to remove few session search restrictions from list of registered session search restrictions.Test scenario:
- prepare
SessionSearchRestrictionobjects
- add session search restriction with usage ofSearchRestrictionService#addSessionSearchRestrictions(java.util.Collection)method
- remove one session search restriction from list of registered session search restrictions.
-
enableAndDisableSearchRestriction
public void enableAndDisableSearchRestriction()
Demonstrates how enable and disable search restrictions (both - session and persistent model based restrictions).Test scenario:
- check whether restrictions are enabled
- disable restrictions
- check whether restrictions are disabled
- enable restrictions again
- check whether restrictions are enabled
-
checkSearchRestrictionCreateAndGetSearchRestrictionsForType
public void checkSearchRestrictionCreateAndGetSearchRestrictionsForType()
Demonstrates how to check whether type has restrictions then create model based restrictions for some type and next obtain them from that type.Test scenario:
- check whether model has some restrictions
- create restrictions for type
- get restrictions from model
-
-