Class DefaultCMSAdminContentSlotServiceTest
java.lang.Object
de.hybris.platform.cms2.servicelayer.services.admin.impl.DefaultCMSAdminContentSlotServiceTest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcalculateNumberExpectedContentSlotsForPage(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.protected List<ContentSlotForPageModel>Generates a list of 1 to 5 content slot relation model mocks for the page.protected List<ContentSlotForTemplateModel>generateContentSlotForTemplateModelMocks(boolean isOverlapExpected) Generates a list of 1 to 5 content slot relation model mocks for the page template.voidsetUp()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoid
-
Constructor Details
-
DefaultCMSAdminContentSlotServiceTest
public DefaultCMSAdminContentSlotServiceTest()
-
-
Method Details
-
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 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 pagecontentSlotsForTemplateCount- the number of content slots on the templateisOverlapExpected- true if there are custom content slots on the page that override the slot on the template, false otherwise- Returns:
-
setUp
public void setUp() -
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()
-