Search in sources :

Example 6 with Title

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

the class TitleImplTest method testTitleWithLinksDisabled.

@Test
protected void testTitleWithLinksDisabled() {
    Utils.enableDataLayer(context, true);
    Title title = getTitleUnderTest(TITLE_RESOURCE_JCR_TITLE_LINK_V2, Title.PN_TITLE_LINK_DISABLED, true);
    Utils.testJSONExport(title, Utils.getTestExporterJSONPath(testBase, "title-linkdisabled"));
}
Also used : Title(com.adobe.cq.wcm.core.components.models.Title) Test(org.junit.jupiter.api.Test)

Example 7 with Title

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

the class TitleImplTest method testGetLink.

@Test
protected void testGetLink() {
    Title title = getTitleUnderTest(TITLE_RESOURCE_JCR_TITLE_LINK_V2);
    assertValidLink(title.getLink(), "https://www.adobe.com", "World", "World title");
    Utils.testJSONExport(title, Utils.getTestExporterJSONPath(testBase, TITLE_RESOURCE_JCR_TITLE_LINK_V2));
}
Also used : Title(com.adobe.cq.wcm.core.components.models.Title) Test(org.junit.jupiter.api.Test)

Example 8 with Title

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

the class TitleImplTest method testGetLinkUrl.

@Test
@SuppressWarnings("deprecation")
protected void testGetLinkUrl() {
    Title title = getTitleUnderTest(TITLE_RESOURCE_JCR_TITLE_LINK_V2);
    assertEquals("https://www.adobe.com", title.getLinkURL());
    Utils.testJSONExport(title, Utils.getTestExporterJSONPath(testBase, TITLE_RESOURCE_JCR_TITLE_LINK_V2));
}
Also used : Title(com.adobe.cq.wcm.core.components.models.Title) Test(org.junit.jupiter.api.Test)

Example 9 with Title

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

the class TitleImplTest method testGetLinkFromRedirectChain.

@Test
protected void testGetLinkFromRedirectChain() {
    Title title = getTitleUnderTest(TITLE_RESOURCE_TITLE_REDIRECT_CHAIN);
    assertValidLink(title.getLink(), "/content/title/redirect/redirect-page-3.html", "Should Redirect to Page 3 (accessibility label)", "Should Redirect to Page 3 (title)");
    Utils.testJSONExport(title, Utils.getTestExporterJSONPath(testBase, TITLE_RESOURCE_TITLE_REDIRECT_CHAIN));
}
Also used : Title(com.adobe.cq.wcm.core.components.models.Title) Test(org.junit.jupiter.api.Test)

Example 10 with Title

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

the class TitleImplTest method testGetLinkFromRedirectToExternalURL.

@Test
protected void testGetLinkFromRedirectToExternalURL() {
    Title title = getTitleUnderTest(TITLE_RESOURCE_TITLE_REDIRECT_EXTERNAL_URL);
    assertValidLink(title.getLink(), "https://www.adobe.com", "Adobe", "Adobe title");
    Utils.testJSONExport(title, Utils.getTestExporterJSONPath(testBase, TITLE_RESOURCE_TITLE_REDIRECT_EXTERNAL_URL));
}
Also used : Title(com.adobe.cq.wcm.core.components.models.Title) Test(org.junit.jupiter.api.Test)

Aggregations

Title (com.adobe.cq.wcm.core.components.models.Title)17 Test (org.junit.jupiter.api.Test)17 Page (com.day.cq.wcm.api.Page)1 StringReader (java.io.StringReader)1 Resource (org.apache.sling.api.resource.Resource)1