use of org.apache.sling.api.resource.Resource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ListImplTest method testOrderByModificationDateDesc.
@Test
public void testOrderByModificationDateDesc() throws Exception {
Resource resource = context.currentResource("/content/list/listTypes/staticOrderByModificationDateDescListType");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
List list = context.request().adaptTo(List.class);
checkListConsistency(list, new String[] { "Page 1", "Page 2" });
}
use of org.apache.sling.api.resource.Resource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ListImplTest method testStaticListType.
@Test
public void testStaticListType() {
Resource resource = context.currentResource("/content/list/listTypes/staticListType");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
List list = context.request().adaptTo(List.class);
assertEquals(2, list.getItems().size());
}
use of org.apache.sling.api.resource.Resource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ListImplTest method testProperties.
@Test
public void testProperties() throws Exception {
Resource resource = context.currentResource("/content/list/listTypes/staticListType");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
List list = context.request().adaptTo(List.class);
assertTrue(list.showDescription());
assertTrue(list.showModificationDate());
assertTrue(list.linkItems());
}
use of org.apache.sling.api.resource.Resource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ListImplTest method testChildrenListType.
@Test
public void testChildrenListType() throws Exception {
Resource resource = context.currentResource("/content/list/listTypes/childrenListType");
slingBindings.put(WCMBindings.PROPERTIES, resource.adaptTo(ValueMap.class));
slingBindings.put(WCMBindings.CURRENT_STYLE, new MockStyle(resource));
List list = context.request().adaptTo(List.class);
assertEquals(3, list.getItems().size());
}
use of org.apache.sling.api.resource.Resource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class OptionsImplTest method testRadioOptionsType.
@Test
public void testRadioOptionsType() throws Exception {
Resource optionsRes = context.currentResource(CONTENT_ROOT + "/radio");
slingBindings.put(WCMBindings.PROPERTIES, optionsRes.adaptTo(ValueMap.class));
slingBindings.put(RESOURCE_PROPERTY, optionsRes);
Options options = context.request().adaptTo(Options.class);
assertEquals(Type.RADIO, options.getType());
}
Aggregations