use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validatePeerReview_noExternalIdentifiersTest.
@Test(expected = ActivityIdentifierValidationException.class)
public void validatePeerReview_noExternalIdentifiersTest() {
PeerReview pr = getPeerReview();
pr.getExternalIdentifiers().getExternalIdentifier().clear();
activityValidator.validatePeerReview(pr, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validatePeerReview_invalidExternalIdentifiersTest.
@Test(expected = ActivityIdentifierValidationException.class)
public void validatePeerReview_invalidExternalIdentifiersTest() {
PeerReview pr = getPeerReview();
pr.getExternalIdentifiers().getExternalIdentifier().get(0).setType(null);
activityValidator.validatePeerReview(pr, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class PeerReviewManagerTest method displayIndexIsSetTo_1_FromUI.
@Test
public void displayIndexIsSetTo_1_FromUI() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
PeerReview p1 = getPeerReview("fromUI-1");
p1 = peerReviewManager.createPeerReview(claimedOrcid, p1, false);
PeerReviewEntity p = peerReviewDao.find(p1.getPutCode());
assertNotNull(p);
assertEquals(Long.valueOf(1), p.getDisplayIndex());
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class PeerReviewManagerTest method testAddMultipleModifiesIndexingStatus.
@Test
public void testAddMultipleModifiesIndexingStatus() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
PeerReview p1 = getPeerReview("extId1");
p1 = peerReviewManager.createPeerReview(claimedOrcid, p1, true);
PeerReview p2 = getPeerReview("extId2");
p2 = peerReviewManager.createPeerReview(claimedOrcid, p2, true);
PeerReview p3 = getPeerReview("extId3");
p3 = peerReviewManager.createPeerReview(claimedOrcid, p3, true);
PeerReviewEntity entity1 = peerReviewDao.find(p1.getPutCode());
PeerReviewEntity entity2 = peerReviewDao.find(p2.getPutCode());
PeerReviewEntity entity3 = peerReviewDao.find(p3.getPutCode());
assertNotNull(entity1.getDisplayIndex());
assertNotNull(entity2.getDisplayIndex());
assertNotNull(entity3.getDisplayIndex());
assertEquals(Long.valueOf(0), entity3.getDisplayIndex());
// Rollback all changes
peerReviewDao.remove(entity1.getId());
peerReviewDao.remove(entity2.getId());
peerReviewDao.remove(entity3.getId());
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validatePeerReviewWithoutDisambiguatedOrg.
@Test(expected = InvalidDisambiguatedOrgException.class)
public void validatePeerReviewWithoutDisambiguatedOrg() {
PeerReview pr = getPeerReview();
pr.getOrganization().setDisambiguatedOrganization(null);
activityValidator.validatePeerReview(pr, null, false, true, Visibility.PUBLIC);
}
Aggregations