LayoutContainerImpl extends AbstractContainerImpl implements LayoutContainer { @Override public @NotNull LayoutType getLayout() { return layout; }  @Override @NotNull LayoutType getLayout();  }
@Test public void testContainerWithPropertiesAndPolicy() { context.contentPolicyMapping(LayoutContainerImpl.RESOURCE_TYPE_V1, new HashMap<String, Object>() {{ put(Container.PN_BACKGROUND_IMAGE_ENABLED, true); put(Container.PN_BACKGROUND_COLOR_ENABLED, true); put(LayoutContainer.PN_LAYOUT, "simple"); }}); LayoutContainer container = getContainerUnderTest(CONTAINER_1); assertEquals( "background-image:url(/content/dam/core-components-examples/library/sample-assets/mountain-range.jpg);background-size:cover;background-repeat:no-repeat;background-color:#000000;", container.getBackgroundStyle(), "Style mismatch"); assertEquals(LayoutContainer.LayoutType.RESPONSIVE_GRID, container.getLayout(), "Layout type mismatch"); assertEquals("test", container.getId(), "ID mismatch"); Object[][] expectedItems = { {"item_1", "Teaser 1"}, {"item_2", "Teaser 2"} }; verifyContainerItems(expectedItems, container.getItems()); assertEquals("core/wcm/components/container/v1/container", container.getExportedType(), "Exported type mismatch"); Utils.testJSONExport(container, Utils.getTestExporterJSONPath(TEST_BASE, "container1")); }
@Test public void testContainerWithPropertiesAndLayoutInPolicy() { context.contentPolicyMapping(LayoutContainerImpl.RESOURCE_TYPE_V1, new HashMap<String, Object>() {{ put(LayoutContainer.PN_LAYOUT, "responsiveGrid"); }}); LayoutContainer container = getContainerUnderTest(CONTAINER_2); 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")); }
@Test public void testContainerNoProperties() { LayoutContainer container = getContainerUnderTest(CONTAINER_2); assertEquals("container-2611f8dc62", container.getId(), "ID mismatch"); assertNull(container.getBackgroundStyle(), "Style"); assertEquals(LayoutContainer.LayoutType.SIMPLE, container.getLayout(), "Layout type mismatch"); }