Search in sources :

Example 61 with PeerReview

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);
}
Also used : PeerReview(org.orcid.jaxb.model.v3.dev1.record.PeerReview) Test(org.junit.Test)

Example 62 with PeerReview

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);
}
Also used : PeerReview(org.orcid.jaxb.model.v3.dev1.record.PeerReview) Test(org.junit.Test)

Example 63 with PeerReview

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());
}
Also used : ClientDetailsEntity(org.orcid.persistence.jpa.entities.ClientDetailsEntity) SourceEntity(org.orcid.persistence.jpa.entities.SourceEntity) PeerReviewEntity(org.orcid.persistence.jpa.entities.PeerReviewEntity) PeerReview(org.orcid.jaxb.model.v3.dev1.record.PeerReview) Test(org.junit.Test) BaseTest(org.orcid.core.BaseTest)

Example 64 with PeerReview

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());
}
Also used : ClientDetailsEntity(org.orcid.persistence.jpa.entities.ClientDetailsEntity) SourceEntity(org.orcid.persistence.jpa.entities.SourceEntity) PeerReviewEntity(org.orcid.persistence.jpa.entities.PeerReviewEntity) PeerReview(org.orcid.jaxb.model.v3.dev1.record.PeerReview) Test(org.junit.Test) BaseTest(org.orcid.core.BaseTest)

Example 65 with PeerReview

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);
}
Also used : PeerReview(org.orcid.jaxb.model.v3.dev1.record.PeerReview) Test(org.junit.Test)

Aggregations

PeerReview (org.orcid.jaxb.model.v3.dev1.record.PeerReview)66 Test (org.junit.Test)49 Response (javax.ws.rs.core.Response)20 DBUnitTest (org.orcid.test.DBUnitTest)20 ExternalID (org.orcid.jaxb.model.v3.dev1.record.ExternalID)12 PeerReviewEntity (org.orcid.persistence.jpa.entities.PeerReviewEntity)9 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)9 Url (org.orcid.jaxb.model.v3.dev1.common.Url)8 Funding (org.orcid.jaxb.model.v3.dev1.record.Funding)8 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)8 Work (org.orcid.jaxb.model.v3.dev1.record.Work)7 BaseTest (org.orcid.core.BaseTest)6 Title (org.orcid.jaxb.model.v3.dev1.common.Title)6 Education (org.orcid.jaxb.model.v3.dev1.record.Education)6 WorkTitle (org.orcid.jaxb.model.v3.dev1.record.WorkTitle)6 PeerReviewSummary (org.orcid.jaxb.model.v3.dev1.record.summary.PeerReviewSummary)6 ArrayList (java.util.ArrayList)5 Day (org.orcid.jaxb.model.v3.dev1.common.Day)5 Month (org.orcid.jaxb.model.v3.dev1.common.Month)5 Year (org.orcid.jaxb.model.v3.dev1.common.Year)5