use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class ActivityValidatorTest method getPeerReview.
public PeerReview getPeerReview() {
PeerReview peerReview = new PeerReview();
peerReview.setCompletionDate(getFuzzyDate());
peerReview.setExternalIdentifiers(getExternalIDs());
peerReview.setGroupId("group-id");
peerReview.setOrganization(getOrganization());
peerReview.setRole(Role.CHAIR);
peerReview.setSubjectContainerName(new Title("subject-container-name"));
peerReview.setSubjectExternalIdentifier(getExternalID());
peerReview.setSubjectName(getWorkTitle());
peerReview.setSubjectType(WorkType.ARTISTIC_PERFORMANCE);
peerReview.setSubjectUrl(new Url("http://test.orcid.org"));
peerReview.setType(PeerReviewType.EVALUATION);
peerReview.setUrl(new Url("http://test.orcid.org"));
peerReview.setVisibility(Visibility.PUBLIC);
return peerReview;
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class PeerReviewManagerTest method testAddPeerReviewToClaimedRecordPreserveUserDefaultVisibility.
@Test
public void testAddPeerReviewToClaimedRecordPreserveUserDefaultVisibility() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
PeerReview peer = getPeerReview(null);
peer = peerReviewManager.createPeerReview(claimedOrcid, peer, true);
peer = peerReviewManager.getPeerReview(claimedOrcid, peer.getPutCode());
assertNotNull(peer);
assertEquals(Visibility.LIMITED, peer.getVisibility());
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class PeerReviewManagerTest method getPeerReview.
private PeerReview getPeerReview(String extIdValue) {
PeerReview peerReview = new PeerReview();
peerReview.setRole(Role.CHAIR);
ExternalIDs extIds = new ExternalIDs();
ExternalID extId = new ExternalID();
extId.setRelationship(Relationship.SELF);
extId.setType("doi");
extId.setUrl(new Url("http://orcid.org"));
if (extIdValue == null) {
extId.setValue("ext-id-value");
} else {
extId.setValue("ext-id-value-" + extIdValue);
}
extIds.getExternalIdentifier().add(extId);
peerReview.setExternalIdentifiers(extIds);
if (extIdValue == null) {
peerReview.setSubjectContainerName(new Title("Peer review title"));
} else {
peerReview.setSubjectContainerName(new Title("Peer review title " + extIdValue));
}
peerReview.setSubjectExternalIdentifier(extId);
Organization org = new Organization();
org.setName("org-name");
OrganizationAddress address = new OrganizationAddress();
address.setCity("city");
address.setCountry(Iso3166Country.US);
org.setAddress(address);
DisambiguatedOrganization disambiguatedOrg = new DisambiguatedOrganization();
disambiguatedOrg.setDisambiguatedOrganizationIdentifier("abc456");
disambiguatedOrg.setDisambiguationSource("WDB");
org.setDisambiguatedOrganization(disambiguatedOrg);
peerReview.setOrganization(org);
peerReview.setType(PeerReviewType.EVALUATION);
peerReview.setVisibility(Visibility.PUBLIC);
return peerReview;
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class PeerReviewManagerTest method testGetAll.
@Test
public void testGetAll() {
String orcid = "0000-0000-0000-0003";
List<PeerReview> elements = peerReviewManager.findPeerReviews(orcid);
boolean found1 = false, found2 = false, found3 = false, found4 = false, found5 = false;
for (PeerReview element : elements) {
if (9 == element.getPutCode()) {
found1 = true;
} else if (10 == element.getPutCode()) {
found2 = true;
} else if (11 == element.getPutCode()) {
found3 = true;
} else if (12 == element.getPutCode()) {
found4 = true;
} else if (13 == element.getPutCode()) {
found5 = true;
} else {
fail("Invalid element found: " + element.getPutCode());
}
}
assertTrue(found1);
assertTrue(found2);
assertTrue(found3);
assertTrue(found4);
assertTrue(found5);
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class PeerReviewManagerTest method testAddPeerReviewToUnclaimedRecordPreservePeerReviewVisibility.
@Test
public void testAddPeerReviewToUnclaimedRecordPreservePeerReviewVisibility() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
PeerReview peer = getPeerReview(null);
peer = peerReviewManager.createPeerReview(unclaimedOrcid, peer, true);
peer = peerReviewManager.getPeerReview(unclaimedOrcid, peer.getPutCode());
assertNotNull(peer);
assertEquals(Visibility.PUBLIC, peer.getVisibility());
}
Aggregations