Class DefaultCategoryServiceDemoTest

    • Constructor Detail

      • DefaultCategoryServiceDemoTest

        public DefaultCategoryServiceDemoTest()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Exception
        Throws:
        java.lang.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

        public void testGetCategoryForCode()
                                    throws java.lang.Exception
        Checks that the category with code "testCategory0" exists.
        Throws:
        java.lang.Exception
      • testGetNonExistingCategory

        public void testGetNonExistingCategory()
                                        throws java.lang.Exception
        Checks that the category with code "gibtesnicht" does NOT exist, and null is returned
        Throws:
        java.lang.Exception
      • testGetNonExistingCategoryForCode

        public void testGetNonExistingCategoryForCode()
                                               throws java.lang.Exception
        Checks that the category with code "gibtesnicht" does NOT exist, and UnknownIdentifierException is thrown.
        Throws:
        java.lang.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

        public void testRootCategories()
                                throws java.lang.Exception
        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:
        java.lang.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()