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 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.void
clearSessionSearchRestriction()
Demonstrates how to clear all registered session search restrictions.void
createAndAddSessionSearchRestriction()
Demonstrates how to createSessionSearchRestriction
object and add it to the session.void
enableAndDisableSearchRestriction()
Demonstrates how enable and disable search restrictions (both - session and persistent model based restrictions).void
removeSessionSearchRestriction()
Demonstrates how to remove few session search restrictions from list of registered session search restrictions.void
setUp()
void
tearDown()
-
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 createSessionSearchRestriction
object and add it to the session.Test scenario:
- prepare
SessionSearchRestriction
object
- 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
SessionSearchRestriction
object
- 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
SessionSearchRestriction
objects
- 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
-
-