use of com.adobe.cq.wcm.core.components.models.Download in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class DownloadImplTest method testDownloadWithDamProperties.
@Test
void testDownloadWithDamProperties() {
Download download = getDownloadUnderTest(DOWNLOAD_2);
assertEquals(DAM_TITLE, download.getTitle());
assertEquals(DAM_DESCRIPTION, download.getDescription());
assertEquals(CONTEXT_PATH + PDF_ASSET_DOWNLOAD_PATH, download.getUrl());
assertEquals(PDF_FILENAME, download.getFilename());
assertEquals(PDF_EXTENSION, download.getExtension());
assertEquals(PDF_FILESIZE_STRING, download.getSize());
assertEquals(PDF_FORMAT_STRING, download.getFormat());
Utils.testJSONExport(download, Utils.getTestExporterJSONPath(TEST_BASE, DOWNLOAD_WITH_DAM_PROPERTIES));
}
use of com.adobe.cq.wcm.core.components.models.Download in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class DownloadImplTest method testFullyConfiguredDownload.
@Test
void testFullyConfiguredDownload() {
Download download = getDownloadUnderTest(DOWNLOAD_1);
assertEquals(TITLE, download.getTitle());
assertEquals(DESCRIPTION, download.getDescription());
assertEquals(CONTEXT_PATH + PDF_ASSET_DOWNLOAD_PATH, download.getUrl());
assertEquals(PDF_FILENAME, download.getFilename());
assertEquals(PDF_EXTENSION, download.getExtension());
assertEquals(PDF_FILESIZE_STRING, download.getSize());
assertEquals(PDF_FORMAT_STRING, download.getFormat());
assertEquals(COMPONENT_ACTION_TEXT, download.getActionText());
Utils.testJSONExport(download, Utils.getTestExporterJSONPath(TEST_BASE, DOWNLOAD_FULLY_CONFIGURED));
}
use of com.adobe.cq.wcm.core.components.models.Download in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class DownloadImplTest method testDownloadWithoutActionText.
@Test
void testDownloadWithoutActionText() {
Download downloadWithoutActionText = getDownloadUnderTest(DOWNLOAD_2);
assertNull(downloadWithoutActionText.getActionText(), "Expected action text is not correct");
Utils.testJSONExport(downloadWithoutActionText, Utils.getTestExporterJSONPath(TEST_BASE, DOWNLOAD_WITHOUT_ACTION_TEXT));
}
use of com.adobe.cq.wcm.core.components.models.Download in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class DownloadImplTest method testDownloadWithTitleType.
@Test
void testDownloadWithTitleType() {
Download download = getDownloadUnderTest(DOWNLOAD_1, Download.PN_TITLE_TYPE, "h5");
assertEquals("h5", download.getTitleType(), "Expected title type is not correct");
Utils.testJSONExport(download, Utils.getTestExporterJSONPath(TEST_BASE, DOWNLOAD_WITH_TITLE_TYPE));
}
use of com.adobe.cq.wcm.core.components.models.Download in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class DownloadImplTest method testFullyConfiguredFileDownload.
@Test
void testFullyConfiguredFileDownload() {
Download download = getDownloadUnderTest(DOWNLOAD_3);
assertEquals(TITLE, download.getTitle());
assertEquals(DESCRIPTION, download.getDescription());
assertEquals(CONTEXT_PATH + PDF_FILE_DOWNLOAD_PATH, download.getUrl());
assertEquals(PDF_FILENAME, download.getFilename());
assertEquals(PDF_EXTENSION, download.getExtension());
assertEquals(PDF_FORMAT_STRING, download.getFormat());
assertEquals(COMPONENT_ACTION_TEXT, download.getActionText());
Utils.testJSONExport(download, Utils.getTestExporterJSONPath(TEST_BASE, DOWNLOAD_FULLY_CONFIGURED_FILE));
}
Aggregations