Search in sources :

Example 26 with List

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

the class ListImplTest method testMaxItems.

@Test
public void testMaxItems() throws Exception {
    Resource resource = context.currentResource("/content/list/listTypes/staticMaxItemsListType");
    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" });
}
Also used : ValueMap(org.apache.sling.api.resource.ValueMap) Resource(org.apache.sling.api.resource.Resource) MockStyle(com.adobe.cq.wcm.core.components.context.MockStyle) List(com.adobe.cq.wcm.core.components.models.List) Test(org.junit.Test)

Example 27 with List

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

the class ListImplTest method testOrderByModificationDateDesc.

@Test
protected void testOrderByModificationDateDesc() {
    List list = getListUnderTest(LIST_10);
    checkListConsistencyByTitle(list, new String[] { "Page 1", "Page 2" });
    Utils.testJSONExport(list, Utils.getTestExporterJSONPath(testBase, LIST_10));
}
Also used : List(com.adobe.cq.wcm.core.components.models.List) Test(org.junit.jupiter.api.Test)

Example 28 with List

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

the class ListImplTest method testTagsListType.

@Test
protected void testTagsListType() {
    List list = getListUnderTest(LIST_5);
    checkListConsistencyByPaths(list, new String[] { "/content/list/pages/page_1/page_1_3" });
    Utils.testJSONExport(list, Utils.getTestExporterJSONPath(testBase, LIST_5));
}
Also used : List(com.adobe.cq.wcm.core.components.models.List) Test(org.junit.jupiter.api.Test)

Example 29 with List

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

the class ListImplTest method testOrderByTitleWithNoTitleForOneItem.

@Test
protected void testOrderByTitleWithNoTitleForOneItem() {
    List list = getListUnderTest(LIST_15);
    checkListConsistencyByPaths(list, new String[] { "/content/list/pages/page_4", "/content/list/pages/page_1", "/content/list/pages/page_2" });
}
Also used : List(com.adobe.cq.wcm.core.components.models.List) Test(org.junit.jupiter.api.Test)

Example 30 with List

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

the class ListImplTest method testOrderByModificationDateWithNoModificationDateForOneItem.

@Test
protected void testOrderByModificationDateWithNoModificationDateForOneItem() {
    List list = getListUnderTest(LIST_13);
    checkListConsistencyByTitle(list, new String[] { "Page 2", "Page 1", "Page 1.2" });
}
Also used : List(com.adobe.cq.wcm.core.components.models.List) Test(org.junit.jupiter.api.Test)

Aggregations

List (com.adobe.cq.wcm.core.components.models.List)32 Test (org.junit.jupiter.api.Test)20 Resource (org.apache.sling.api.resource.Resource)13 ValueMap (org.apache.sling.api.resource.ValueMap)13 MockStyle (com.adobe.cq.wcm.core.components.context.MockStyle)11 Test (org.junit.Test)11 SearchResult (com.day.cq.search.result.SearchResult)3 SimpleSearch (com.day.cq.search.SimpleSearch)2 ComponentExporter (com.adobe.cq.export.json.ComponentExporter)1 ExporterConstants (com.adobe.cq.export.json.ExporterConstants)1 ListItem (com.adobe.cq.wcm.core.components.models.ListItem)1 AbstractComponentImpl (com.adobe.cq.wcm.core.components.util.AbstractComponentImpl)1 Predicate (com.day.cq.search.Predicate)1 Hit (com.day.cq.search.result.Hit)1 TagManager (com.day.cq.tagging.TagManager)1 NameConstants (com.day.cq.wcm.api.NameConstants)1 Page (com.day.cq.wcm.api.Page)1 Style (com.day.cq.wcm.api.designer.Style)1 JsonProperty (com.fasterxml.jackson.annotation.JsonProperty)1 Serializable (java.io.Serializable)1