use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.
the class AffiliationsManagerImpl method createItem.
private Item createItem(OrgAffiliationRelationEntity orgAffiliationEntity) {
Item item = new Item();
item.setItemName(orgAffiliationEntity.getOrg().getName());
item.setItemType(AffiliationType.EDUCATION.equals(orgAffiliationEntity.getAffiliationType()) ? ItemType.EDUCATION : ItemType.EMPLOYMENT);
item.setPutCode(String.valueOf(orgAffiliationEntity.getId()));
return item;
}
use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.
the class PeerReviewManagerImpl method createItemList.
private List<Item> createItemList(PeerReviewEntity peerReviewEntity) {
Item item = new Item();
item.setItemName(peerReviewEntity.getSubjectName());
item.setItemType(ItemType.PEER_REVIEW);
item.setPutCode(String.valueOf(peerReviewEntity.getId()));
return Arrays.asList(item);
}
use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.
the class AffiliationsManagerImpl method createItemList.
private List<Item> createItemList(OrgAffiliationRelationEntity orgAffiliationEntity) {
Item item = new Item();
item.setItemName(orgAffiliationEntity.getOrg().getName());
item.setItemType(AffiliationType.EDUCATION.value().equals(orgAffiliationEntity.getAffiliationType().value()) ? ItemType.EDUCATION : ItemType.EMPLOYMENT);
item.setPutCode(String.valueOf(orgAffiliationEntity.getId()));
return Arrays.asList(item);
}
use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.
the class ExternalIDValidatorTest method testEmptyRelationshipOnNotificationItemExternalIds_flagOn.
@Test(expected = ActivityIdentifierValidationException.class)
public void testEmptyRelationshipOnNotificationItemExternalIds_flagOn() {
validator.setRequireRelationshipOnExternalIdentifier(true);
Item i = new Item();
Item i2 = new Item();
Items items = new Items();
ExternalID id1 = new ExternalID();
id1.setRelationship(Relationship.SELF);
id1.setType("doi");
id1.setValue("value1");
id1.setUrl(new Url("http://value1.com"));
ExternalID id2 = new ExternalID();
id2.setRelationship(null);
id2.setType("source-work-id");
id2.setValue("value2");
id2.setUrl(new Url("http://value1.com"));
i.setExternalIdentifier(id1);
i2.setExternalIdentifier(id2);
items.getItems().add(i);
items.getItems().add(i2);
// both valid
validator.validateNotificationItems(items);
fail("no exception thrown for invalid type");
}
use of net.minecraft.server.v1_16_R2.Item in project ORCID-Source by ORCID.
the class ExternalIDValidatorTest method testEmptyRelationshipOnNotificationItemExternalIds_flagOff.
@Test
public void testEmptyRelationshipOnNotificationItemExternalIds_flagOff() {
Item i = new Item();
Item i2 = new Item();
Items items = new Items();
ExternalID id1 = new ExternalID();
id1.setRelationship(Relationship.SELF);
id1.setType("doi");
id1.setValue("value1");
id1.setUrl(new Url("http://value1.com"));
ExternalID id2 = new ExternalID();
id2.setRelationship(null);
id2.setType("source-work-id");
id2.setValue("value2");
id2.setUrl(new Url("http://value1.com"));
i.setExternalIdentifier(id1);
i2.setExternalIdentifier(id2);
items.getItems().add(i);
items.getItems().add(i2);
// both valid
validator.validateNotificationItems(items);
}
Aggregations