Class DefaultMulticountryCMSItemFacadeIntegrationTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.cmsfacades.util.BaseIntegrationTest
-
- de.hybris.platform.cmsfacades.cmsitems.impl.DefaultMulticountryCMSItemFacadeIntegrationTest
-
- All Implemented Interfaces:
JaloSessionHolder
@IntegrationTest public class DefaultMulticountryCMSItemFacadeIntegrationTest extends BaseIntegrationTest
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGLOBAL_CATALOG_NAMEstatic java.lang.StringGLOBAL_SEARCH_BOX_SLOT_IDstatic java.lang.StringGLOBAL_SEARCH_BOX_SLOT_POSITIONstatic java.lang.StringLOCAL_ANOTHER_PAGEstatic java.lang.StringLOCAL_CATALOG_NAMEstatic java.lang.StringLOCAL_HOMEPAGEstatic java.lang.StringNEWLY_CREATED_SLOT_NAMEstatic java.lang.StringONLINE_CATALOG_VERSIONstatic java.lang.StringREGION_CATALOG_NAMEstatic java.lang.StringSTAGED_CATALOG_VERSION-
Fields inherited from class de.hybris.platform.cmsfacades.util.BaseIntegrationTest
springCustomContextLoader, userService
-
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 DefaultMulticountryCMSItemFacadeIntegrationTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancomponentsBelongToCatalogVersion(java.util.List<java.lang.String> componentUuids, java.lang.String catalog, java.lang.String catalogVersion)Verifies whether the each uuid in the list belongs to provided catalog version.protected ItemSynchronizationDatagetItemSyncData(java.lang.String uid, java.lang.String catalogId, java.lang.String catalogVersion, java.lang.String itemType)protected java.util.Optional<PageContentSlotData>getNewCreatedContentDataSlotForPage(java.lang.String pageName, java.lang.String slotUid)Retrieves the list of content slots (PageContentSlotData) for provided page and finds there a slot with provided uid.protected java.lang.StringgetUuid(java.lang.String uid, java.lang.String catalogId, java.lang.String catalogVersion)Converts uid, catalog and catalog version to uuid.protected java.util.Map<java.lang.String,java.lang.Object>preparePayloadForNewSlot(java.lang.String slotName, java.lang.Boolean isSlotCustom, java.lang.String sourceSlotUUID, CloneAction cloneAction)Prepares payload for a new slotprotected voidsetEnv()Sets the environmentvoidsetUp()voidshouldChangePageStatusToCheckAfterCreatingCustomSlot()voidshouldChangePageStatusToCheckAfterCustomSlotIsRemoved()voidshouldCreateCustomSlotForHomePageUk()voidshouldCreateCustomSlotOnTopOfAlreadyCreatedLocalSlotInSameCatalogVersion()voidshouldCreateCustomSlotWithOriginalReferencedComponents()voidshouldCreateEmptyCustomSlot()voidshouldCreateEmptyLocalSlot()voidshouldCreateLocalSlotWithingElectronicsUkCatalog()voidshouldThrowExceptionWhenRemovingLocalSlotThatWasOverridenWithCustomSlot()voidshouldThrowExceptionWhenTryingToOverrideCustomSlotWithAnotherCustomSlot()-
Methods inherited from class de.hybris.platform.cmsfacades.util.BaseIntegrationTest
setCurrentUser, setCurrentUserCmsEditor, setCurrentUserCmsManager
-
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
-
-
-
-
Field Detail
-
NEWLY_CREATED_SLOT_NAME
public static java.lang.String NEWLY_CREATED_SLOT_NAME
-
GLOBAL_SEARCH_BOX_SLOT_ID
public static java.lang.String GLOBAL_SEARCH_BOX_SLOT_ID
-
GLOBAL_SEARCH_BOX_SLOT_POSITION
public static java.lang.String GLOBAL_SEARCH_BOX_SLOT_POSITION
-
GLOBAL_CATALOG_NAME
public static java.lang.String GLOBAL_CATALOG_NAME
-
REGION_CATALOG_NAME
public static java.lang.String REGION_CATALOG_NAME
-
LOCAL_CATALOG_NAME
public static java.lang.String LOCAL_CATALOG_NAME
-
LOCAL_HOMEPAGE
public static java.lang.String LOCAL_HOMEPAGE
-
LOCAL_ANOTHER_PAGE
public static java.lang.String LOCAL_ANOTHER_PAGE
-
ONLINE_CATALOG_VERSION
public static java.lang.String ONLINE_CATALOG_VERSION
-
STAGED_CATALOG_VERSION
public static java.lang.String STAGED_CATALOG_VERSION
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception- Throws:
java.lang.Exception
-
shouldCreateCustomSlotForHomePageUk
public void shouldCreateCustomSlotForHomePageUk() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldChangePageStatusToCheckAfterCreatingCustomSlot
public void shouldChangePageStatusToCheckAfterCreatingCustomSlot() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldChangePageStatusToCheckAfterCustomSlotIsRemoved
public void shouldChangePageStatusToCheckAfterCustomSlotIsRemoved() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
getItemSyncData
protected ItemSynchronizationData getItemSyncData(java.lang.String uid, java.lang.String catalogId, java.lang.String catalogVersion, java.lang.String itemType)
-
shouldCreateLocalSlotWithingElectronicsUkCatalog
public void shouldCreateLocalSlotWithingElectronicsUkCatalog() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldCreateCustomSlotOnTopOfAlreadyCreatedLocalSlotInSameCatalogVersion
public void shouldCreateCustomSlotOnTopOfAlreadyCreatedLocalSlotInSameCatalogVersion() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldCreateEmptyCustomSlot
public void shouldCreateEmptyCustomSlot() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldCreateEmptyLocalSlot
public void shouldCreateEmptyLocalSlot() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldCreateCustomSlotWithOriginalReferencedComponents
public void shouldCreateCustomSlotWithOriginalReferencedComponents() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldThrowExceptionWhenRemovingLocalSlotThatWasOverridenWithCustomSlot
public void shouldThrowExceptionWhenRemovingLocalSlotThatWasOverridenWithCustomSlot() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
shouldThrowExceptionWhenTryingToOverrideCustomSlotWithAnotherCustomSlot
public void shouldThrowExceptionWhenTryingToOverrideCustomSlotWithAnotherCustomSlot() throws CMSItemNotFoundException- Throws:
CMSItemNotFoundException
-
componentsBelongToCatalogVersion
protected boolean componentsBelongToCatalogVersion(java.util.List<java.lang.String> componentUuids, java.lang.String catalog, java.lang.String catalogVersion)Verifies whether the each uuid in the list belongs to provided catalog version. This method used to verify that compoents were cloned (or referenced) and a new slot.- Parameters:
componentUuids- the list of component uuidscatalog- the catalogcatalogVersion- the catalog version- Returns:
- true if all uuids belongs to provided catalog version, false otherwise.
-
getUuid
protected java.lang.String getUuid(java.lang.String uid, java.lang.String catalogId, java.lang.String catalogVersion)Converts uid, catalog and catalog version to uuid.- Parameters:
uid- the id of the itemcatalogId- the catalogcatalogVersion- the catalog version- Returns:
- the uuid
-
preparePayloadForNewSlot
protected java.util.Map<java.lang.String,java.lang.Object> preparePayloadForNewSlot(java.lang.String slotName, java.lang.Boolean isSlotCustom, java.lang.String sourceSlotUUID, CloneAction cloneAction)Prepares payload for a new slot- Parameters:
slotName- the slot nameisSlotCustom- whether the slot is custom or not (local)sourceSlotUUID- the source slot that will be overriddencloneAction- action that says what to do with components inside (clone, reference, remove)- Returns:
- the payload for a new slot
-
setEnv
protected void setEnv()
Sets the environment
-
getNewCreatedContentDataSlotForPage
protected java.util.Optional<PageContentSlotData> getNewCreatedContentDataSlotForPage(java.lang.String pageName, java.lang.String slotUid) throws CMSItemNotFoundException
Retrieves the list of content slots (PageContentSlotData) for provided page and finds there a slot with provided uid.- Parameters:
pageName- the page name for which the list of slots will be retrieved.slotUid- the slot id that needs to be in the list of page slots- Returns:
- the slot that matches the provided uid or nothing. The result is wrapped in Optional.
- Throws:
CMSItemNotFoundException
-
-