Search in sources :

Example 16 with ContentFragment

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

the class ContentFragmentImplTest method structuredOnlyInvalidPath.

@Test
void structuredOnlyInvalidPath() {
    ContentFragment fragment = getModelInstanceUnderTest(CF_STRUCTURED_INVALID_PATH);
    assertNotNull(fragment, "Model shouldn't be null when the path is not a content fragment");
}
Also used : DAMContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.DAMContentFragment) ContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.ContentFragment) Test(org.junit.jupiter.api.Test)

Example 17 with ContentFragment

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

the class ContentFragmentImplTest method structured.

@Test
void structured() {
    ContentFragment fragment = getModelInstanceUnderTest(CF_STRUCTURED);
    assertContentFragment(fragment, TITLE, DESCRIPTION, STRUCTURED_TYPE, STRUCTURED_NAME, ASSOCIATED_CONTENT, MAIN, SECOND_STRUCTURED);
    Utils.testJSONExport(fragment, Utils.getTestExporterJSONPath(TEST_BASE, CF_STRUCTURED));
}
Also used : DAMContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.DAMContentFragment) ContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.ContentFragment) Test(org.junit.jupiter.api.Test)

Example 18 with ContentFragment

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

the class ContentFragmentImplTest method textOnlyMultipleElements.

@Test
void textOnlyMultipleElements() {
    ContentFragment fragment = getModelInstanceUnderTest(CF_TEXT_ONLY_MULTIPLE_ELEMENTS);
    assertContentFragment(fragment, TITLE, DESCRIPTION, TEXT_ONLY_TYPE, TEXT_ONLY_NAME, ASSOCIATED_CONTENT, SECOND_TEXT_ONLY, MAIN);
    Utils.testJSONExport(fragment, Utils.getTestExporterJSONPath(TEST_BASE, CF_TEXT_ONLY_MULTIPLE_ELEMENTS));
}
Also used : DAMContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.DAMContentFragment) ContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.ContentFragment) Test(org.junit.jupiter.api.Test)

Example 19 with ContentFragment

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

the class ContentFragmentImplTest method textOnlyNonExistingVariation.

@Test
void textOnlyNonExistingVariation() {
    ContentFragment fragment = getModelInstanceUnderTest(CF_TEXT_ONLY_NON_EXISTING_VARIATION);
    assertContentFragment(fragment, TITLE, DESCRIPTION, TEXT_ONLY_TYPE, TEXT_ONLY_NAME, ASSOCIATED_CONTENT, MAIN, SECOND_TEXT_ONLY);
    Utils.testJSONExport(fragment, Utils.getTestExporterJSONPath(TEST_BASE, CF_TEXT_ONLY_NON_EXISTING_VARIATION));
}
Also used : DAMContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.DAMContentFragment) ContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.ContentFragment) Test(org.junit.jupiter.api.Test)

Example 20 with ContentFragment

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

the class ContentFragmentImplTest method structuredMultipleElements.

@Test
void structuredMultipleElements() {
    ContentFragment fragment = getModelInstanceUnderTest(CF_STRUCTURED_MULTIPLE_ELEMENTS);
    assertContentFragment(fragment, TITLE, DESCRIPTION, STRUCTURED_TYPE, STRUCTURED_NAME, ASSOCIATED_CONTENT, SECOND_STRUCTURED, MAIN);
    Utils.testJSONExport(fragment, Utils.getTestExporterJSONPath(TEST_BASE, CF_STRUCTURED_MULTIPLE_ELEMENTS));
}
Also used : DAMContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.DAMContentFragment) ContentFragment(com.adobe.cq.wcm.core.components.models.contentfragment.ContentFragment) Test(org.junit.jupiter.api.Test)

Aggregations

ContentFragment (com.adobe.cq.wcm.core.components.models.contentfragment.ContentFragment)26 DAMContentFragment (com.adobe.cq.wcm.core.components.models.contentfragment.DAMContentFragment)26 Test (org.junit.jupiter.api.Test)26 Resource (org.apache.sling.api.resource.Resource)3 ComponentExporter (com.adobe.cq.export.json.ComponentExporter)1 StringReader (java.io.StringReader)1