Class DefaultCMSAdminContentSlotServiceTest


  • @UnitTest
    public class DefaultCMSAdminContentSlotServiceTest
    extends java.lang.Object
    • Constructor Detail

      • DefaultCMSAdminContentSlotServiceTest

        public DefaultCMSAdminContentSlotServiceTest()
    • Method Detail

      • generateContentSlotForPageModelMocks

        protected java.util.List<ContentSlotForPageModel> generateContentSlotForPageModelMocks()
        Generates a list of 1 to 5 content slot relation model mocks for the page.
        Returns:
        the list content slot relation model mocks for the page
      • generateContentSlotForTemplateModelMocks

        protected java.util.List<ContentSlotForTemplateModel> generateContentSlotForTemplateModelMocks​(boolean isOverlapExpected)
        Generates a list of 1 to 5 content slot relation model mocks for the page template.
        Parameters:
        withPositions - true if the template slots should have a position parameter to test the filtering out of custom content slots on the page
        Returns:
        the list content slot relation model mocks for the page template
      • calculateNumberExpectedContentSlotsForPage

        protected int calculateNumberExpectedContentSlotsForPage​(int contentSlotsForPageCount,
                                                                 int contentSlotsForTemplateCount,
                                                                 boolean isOverlapExpected)
        Calculates how many content slots should be returned, based on the number of content slots on the page, the template and if an overlap of slots (custom page slots replacing template slots) is expected.
        Parameters:
        contentSlotsForPageCount - the number of content slots on the page
        contentSlotsForTemplateCount - the number of content slots on the template
        isOverlapExpected - true if there are custom content slots on the page that override the slot on the template, false otherwise
        Returns:
      • setUp

        public void setUp()
      • willCreateAndAssignSlotsToThePositionsNotBusyWithSharedSlots

        public void willCreateAndAssignSlotsToThePositionsNotBusyWithSharedSlots()
      • willReturnOnlyContentSlotsForPage

        public void willReturnOnlyContentSlotsForPage()
      • willReturnContentSlotsForPageAndForMasterTemplate

        public void willReturnContentSlotsForPageAndForMasterTemplate()
      • willReturnCustomContentSlotsInTemplateSlotPositions

        public void willReturnCustomContentSlotsInTemplateSlotPositions()
      • willReturnCustomContentSlotsInTemplateSlotPositionsAndSetOverrideToTrue

        public void willReturnCustomContentSlotsInTemplateSlotPositionsAndSetOverrideToTrue()
      • willReturnPositionOfContentSlotFromPage

        public void willReturnPositionOfContentSlotFromPage()
      • willReturnPositionOfContentSlotFromPageTemplate

        public void willReturnPositionOfContentSlotFromPageTemplate()
      • shouldThrowTypePermissionExceptionWhenAddComponentToSlotAndIfSlotDoesNotHaveChangePermission

        public void shouldThrowTypePermissionExceptionWhenAddComponentToSlotAndIfSlotDoesNotHaveChangePermission()
      • shouldThrowTypePermissionExceptionWhenUpdateComponentPositionInSlotAndIfSlotDoesNotHaveChangePermission

        public void shouldThrowTypePermissionExceptionWhenUpdateComponentPositionInSlotAndIfSlotDoesNotHaveChangePermission()
      • shouldThrowUnknownIdentifierExceptionWhenOneOfTheRequestedContentSlotsCouldNotBeFound

        public void shouldThrowUnknownIdentifierExceptionWhenOneOfTheRequestedContentSlotsCouldNotBeFound()
      • shouldThrowAmbiguousIdentifierExceptionWhenOneOfTheRequestedContentSlotsReturnedMoreThanOneResult

        public void shouldThrowAmbiguousIdentifierExceptionWhenOneOfTheRequestedContentSlotsReturnedMoreThanOneResult()
      • shouldReturnTheListOfContentSlotsRetrieved

        public void shouldReturnTheListOfContentSlotsRetrieved()