Package de.hybris.platform.category.impl
Class DefaultCategoryServiceDemoTest
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.category.impl.DefaultCategoryServiceDemoTest
- All Implemented Interfaces:
JaloSessionHolder
Tests for the
DefaultCategoryService.-
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()voidvoidvoidvoidvoidvoidTests the categoryService.getCategories(catalogVersion, product) gets the categories that belong to hwcatalog.online and contain the product with code "HW2300-4121", gets the codes of the result, and checks whether they are expected.voidChecks that the category with code "testCategory0" exists.voidChecks that the category with code "gibtesnicht" does NOT exist, and null is returnedvoidChecks that the category with code "gibtesnicht" does NOT exist, and UnknownIdentifierException is thrown.voidChecks all paths of the specific category.voidTests whether the category is empty.voidTests whether the category is a root category.voidTests the categoryService.getRootCategories(catalogVersion).voidTests to add principals for unsaved category without exception.Methods 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
-
DefaultCategoryServiceDemoTest
public DefaultCategoryServiceDemoTest()
-
-
Method Details
-
setUp
- Throws:
Exception
-
shouldGetCategoryPathForProduct
public void shouldGetCategoryPathForProduct() -
shouldGetCategoryPathForProductWithCategoryClassOnly
public void shouldGetCategoryPathForProductWithCategoryClassOnly() -
testGetCategories
public void testGetCategories()Tests the categoryService.getCategories(catalogVersion, product)- gets the categories that belong to hwcatalog.online and contain the product with code "HW2300-4121",
- gets the codes of the result, and checks whether they are expected.
-
testGetCategoryForCode
Checks that the category with code "testCategory0" exists.- Throws:
Exception
-
testGetNonExistingCategory
Checks that the category with code "gibtesnicht" does NOT exist, and null is returned- Throws:
Exception
-
testGetNonExistingCategoryForCode
Checks that the category with code "gibtesnicht" does NOT exist, and UnknownIdentifierException is thrown.- Throws:
Exception
-
testGetPaths
public void testGetPaths()Checks all paths of the specific category.- tests the category "HW1240" has two paths, and the detail of them,
- tests the category "HW2320" has two paths, and the detail of them.
-
testIsEmpty
public void testIsEmpty()Tests whether the category is empty.- checks the category "HW2320" is not empty,
- creates a new category "flexible_category", and checks that is empty,
- creates another category "empty_category" and assign the "flexible_category" as its super-category,
- checks that the "flexible_category" is not empty now,
- removes the "empty_category", and checks that the "flexible_category" is empty again,
- creates a product and assign it to the "flexible_category",
- checks that the "flexible_category" is not empty,
- removes the product, and checks that the category "flexible_category" is empty again.
-
testIsRoot
public void testIsRoot()Tests whether the category is a root category.- checks the category "HW1000" is a root category,
- checks the category "HW1100" is not a root category.
-
testRootCategories
Tests the categoryService.getRootCategories(catalogVersion).- gets the root categories of testCatalog.Online, and tests that they don't have super categories,
- gets the root categories of a catalog version, and tests the result,
- gets the root categories of a classification system version, and tests the result.
- Throws:
Exception
-
shouldSetAllowedPrincipalsForCategoryAndRecursivelyToAllSubcategoriesAndSupercategories
public void shouldSetAllowedPrincipalsForCategoryAndRecursivelyToAllSubcategoriesAndSupercategories() -
shouldSetAllowedPrincipalsOnlyForPassedCategory
public void shouldSetAllowedPrincipalsOnlyForPassedCategory() -
testSetAllowedPrincipalsWitNotSavedModels
public void testSetAllowedPrincipalsWitNotSavedModels()Tests to add principals for unsaved category without exception. -
shouldReturnCategoryPathForProductWithRootAsFirstElementOfList
public void shouldReturnCategoryPathForProductWithRootAsFirstElementOfList()
-