Search in sources :

Example 6 with LayoutContainer

use of com.adobe.cq.wcm.core.components.models.LayoutContainer in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class LayoutContainerImplTest method testContainerWithPropertiesAndLayoutInPolicy.

@Test
public void testContainerWithPropertiesAndLayoutInPolicy() {
    context.contentPolicyMapping(LayoutContainerImpl.RESOURCE_TYPE_V1, new HashMap<String, Object>() {

        {
            put(LayoutContainer.PN_LAYOUT, "responsiveGrid");
        }
    });
    LayoutContainer container = getContainerUnderTest(CONTAINER_2);
    // layout set in content policy
    assertEquals(LayoutContainer.LayoutType.RESPONSIVE_GRID, container.getLayout(), "Layout type mismatch");
    assertEquals("core/wcm/components/container/v1/container", container.getExportedType(), "Exported type mismatch");
    Utils.testJSONExport(container, Utils.getTestExporterJSONPath(TEST_BASE, "container2"));
}
Also used : LayoutContainer(com.adobe.cq.wcm.core.components.models.LayoutContainer) Test(org.junit.jupiter.api.Test)

Example 7 with LayoutContainer

use of com.adobe.cq.wcm.core.components.models.LayoutContainer in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class LayoutContainerImplTest method testContainerWithPropertiesAndNoPolicy.

@Test
public void testContainerWithPropertiesAndNoPolicy() {
    LayoutContainer container = getContainerUnderTest(CONTAINER_3);
    assertEquals("container-d7eba9c61f", container.getId(), "ID mismatch");
    assertNull(container.getBackgroundStyle(), "Style");
}
Also used : LayoutContainer(com.adobe.cq.wcm.core.components.models.LayoutContainer) Test(org.junit.jupiter.api.Test)

Aggregations

LayoutContainer (com.adobe.cq.wcm.core.components.models.LayoutContainer)7 Test (org.junit.jupiter.api.Test)7