use of edu.harvard.iq.dataverse.TermsOfUseAndAccess in project dataverse by IQSS.
the class FileUtilTest method testIsDownloadPopupRequiredHasTermsOfUseAndCc0License.
@Test
public void testIsDownloadPopupRequiredHasTermsOfUseAndCc0License() {
DatasetVersion dsv1 = new DatasetVersion();
dsv1.setVersionState(DatasetVersion.VersionState.RELEASED);
TermsOfUseAndAccess termsOfUseAndAccess = new TermsOfUseAndAccess();
/**
* @todo Ask if setting the license to CC0 should be enough to not show
* the popup when the are Terms of Use. This feels like a bug since the
* Terms of Use should probably be shown.
*/
termsOfUseAndAccess.setLicense(TermsOfUseAndAccess.License.CC0);
termsOfUseAndAccess.setTermsOfUse("be excellent to each other");
dsv1.setTermsOfUseAndAccess(termsOfUseAndAccess);
assertEquals(false, FileUtil.isDownloadPopupRequired(dsv1));
}
use of edu.harvard.iq.dataverse.TermsOfUseAndAccess in project dataverse by IQSS.
the class FileUtilTest method testIsPubliclyDownloadable2.
@Test
public void testIsPubliclyDownloadable2() {
FileMetadata nonRestrictedFileMetadata = new FileMetadata();
DatasetVersion dsv = new DatasetVersion();
TermsOfUseAndAccess termsOfUseAndAccess = new TermsOfUseAndAccess();
termsOfUseAndAccess.setTermsOfUse("be excellent to each other");
dsv.setTermsOfUseAndAccess(termsOfUseAndAccess);
dsv.setVersionState(DatasetVersion.VersionState.RELEASED);
nonRestrictedFileMetadata.setDatasetVersion(dsv);
Dataset dataset = new Dataset();
dsv.setDataset(dataset);
nonRestrictedFileMetadata.setRestricted(false);
assertEquals(false, FileUtil.isPubliclyDownloadable(nonRestrictedFileMetadata));
}
Aggregations