Search in sources :

Example 1 with Page

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

the class PageImplTest method testGetLastModifiedDate.

@Test
public void testGetLastModifiedDate() throws ParseException {
    Page page = getPageUnderTest(PAGE);
    Calendar calendar = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
    calendar.setTime(sdf.parse("2016-01-20T10:33:36.000+0100"));
    assertEquals(page.getLastModifiedDate(), calendar);
}
Also used : Calendar(java.util.Calendar) Page(com.adobe.cq.wcm.core.components.models.Page) SimpleDateFormat(java.text.SimpleDateFormat) Test(org.junit.Test)

Example 2 with Page

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

the class PageImplTest method testDesign.

@Test
public void testDesign() {
    Page page = getPageUnderTest(PAGE);
    assertEquals(DESIGN_PATH, page.getDesignPath());
    assertEquals(DESIGN_PATH + "/static.css", page.getStaticDesignPath());
}
Also used : Page(com.adobe.cq.wcm.core.components.models.Page) Test(org.junit.Test)

Example 3 with Page

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

the class PageImplTest method testGetClientLibCategories.

@Test
public void testGetClientLibCategories() throws Exception {
    Page page = getPageUnderTest(PAGE);
    assertEquals("coretest.product-page", page.getClientLibCategories()[0]);
}
Also used : Page(com.adobe.cq.wcm.core.components.models.Page) Test(org.junit.Test)

Example 4 with Page

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

the class PageImplTest method testKeywords.

@Test
public void testKeywords() {
    Page page = getPageUnderTest(PAGE);
    String[] keywordsArray = page.getKeywords();
    assertEquals(3, keywordsArray.length);
    Set<String> keywords = new HashSet<>(keywordsArray.length);
    keywords.addAll(Arrays.asList(keywordsArray));
    assertTrue(keywords.contains("one") && keywords.contains("two") && keywords.contains("three"));
}
Also used : Page(com.adobe.cq.wcm.core.components.models.Page) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 5 with Page

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

the class PageImplTest method testGetTemplateName.

@Test
public void testGetTemplateName() throws Exception {
    Page page = getPageUnderTest(PAGE);
    assertEquals("product-page", page.getTemplateName());
}
Also used : Page(com.adobe.cq.wcm.core.components.models.Page) Test(org.junit.Test)

Aggregations

Page (com.adobe.cq.wcm.core.components.models.Page)31 Test (org.junit.jupiter.api.Test)21 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)17 SimpleDateFormat (java.text.SimpleDateFormat)11 HtmlPageItem (com.adobe.cq.wcm.core.components.models.HtmlPageItem)10 NavigationItem (com.adobe.cq.wcm.core.components.models.NavigationItem)10 Calendar (java.util.Calendar)10 HashSet (java.util.HashSet)10 HashMap (java.util.HashMap)9 Map (java.util.Map)9 Test (org.junit.Test)9 SeoTags (com.adobe.aem.wcm.seo.SeoTags)8 Utils.getTestExporterJSONPath (com.adobe.cq.wcm.core.components.Utils.getTestExporterJSONPath)8 Utils.testJSONExport (com.adobe.cq.wcm.core.components.Utils.testJSONExport)8 HtmlPageItemsConfig (com.adobe.cq.wcm.core.components.config.HtmlPageItemsConfig)8 MockHtmlLibraryManager (com.adobe.cq.wcm.core.components.testing.MockHtmlLibraryManager)8 MockPersistenceStrategy (com.adobe.cq.wcm.core.components.testing.MockPersistenceStrategy)8 MockProductInfoProvider (com.adobe.cq.wcm.core.components.testing.MockProductInfoProvider)8 Utils (com.adobe.cq.wcm.core.components.testing.Utils)8 ClientLibrary (com.adobe.granite.ui.clientlibs.ClientLibrary)8