本文整理汇总了Java中org.gbif.api.model.registry.Dataset.setLicense方法的典型用法代码示例。如果您正苦于以下问题:Java Dataset.setLicense方法的具体用法?Java Dataset.setLicense怎么用?Java Dataset.setLicense使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gbif.api.model.registry.Dataset
的用法示例。
在下文中一共展示了Dataset.setLicense方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testHBaseResultRequiresUpdate
import org.gbif.api.model.registry.Dataset; //导入方法依赖的package包/类
@Test
public void testHBaseResultRequiresUpdate() {
Organization mockPublishingOrg = getMockOrganization();
Country publishingCountry = Country.ANTARCTICA;
mockPublishingOrg.setCountry(publishingCountry);
License license = License.CC0_1_0;
Result hbaseValues = mockHBaseResult(mockPublishingOrg.getKey().toString(), publishingCountry, license);
Dataset dataset = getMockDataset();
dataset.setPublishingOrganizationKey(mockPublishingOrg.getKey());
dataset.setLicense(license);
assertFalse(OCC_MUTATOR.requiresUpdate(dataset, mockPublishingOrg, hbaseValues));
//now change the license
dataset.setLicense(License.CC_BY_4_0);
assertTrue(OCC_MUTATOR.requiresUpdate(dataset, mockPublishingOrg, hbaseValues));
}
示例2: testRequiresUpdateDataset
import org.gbif.api.model.registry.Dataset; //导入方法依赖的package包/类
@Test
public void testRequiresUpdateDataset() {
Organization org = getMockOrganization();
Dataset datasetBefore = getMockDataset();
datasetBefore.setPublishingOrganizationKey(org.getKey());
datasetBefore.setLicense(License.UNSPECIFIED);
Dataset datasetAfter = new Dataset();
datasetAfter.setKey(datasetBefore.getKey());
datasetAfter.setPublishingOrganizationKey(org.getKey());
datasetAfter.setLicense(License.CC0_1_0);
assertTrue(OCC_MUTATOR.requiresUpdate(datasetBefore, datasetAfter));
assertTrue(StringUtils.isNotBlank(OCC_MUTATOR.generateUpdateMessage(org, org, datasetBefore, datasetAfter)
.orElse("")));
}
示例3: testRequiresUpdateDatasetOrganization
import org.gbif.api.model.registry.Dataset; //导入方法依赖的package包/类
@Test
public void testRequiresUpdateDatasetOrganization() {
UUID randomUUID = UUID.randomUUID();
Organization orgBefore = new Organization();
orgBefore.setKey(randomUUID);
orgBefore.setEndorsementApproved(true);
orgBefore.setCountry(Country.ANDORRA);
Organization orgAfter = new Organization();
orgAfter.setKey(randomUUID);
orgAfter.setEndorsementApproved(true);
orgAfter.setCountry(Country.ANGOLA);
assertTrue(OCC_MUTATOR.requiresUpdate(orgBefore, orgAfter));
Dataset dataset = getMockDataset();
dataset.setPublishingOrganizationKey(orgBefore.getKey());
dataset.setLicense(License.CC0_1_0);
assertTrue(StringUtils.isNotBlank(OCC_MUTATOR.generateUpdateMessage(orgBefore, orgAfter, dataset, dataset)
.orElse("")));
}