use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validatePeerReviewWithoutOrg.
@Test(expected = InvalidOrgException.class)
public void validatePeerReviewWithoutOrg() {
PeerReview pr = getPeerReview();
pr.setOrganization(null);
activityValidator.validatePeerReview(pr, null, false, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validatePeerReview_dontChangeVisibilityTest.
@Test(expected = VisibilityMismatchException.class)
public void validatePeerReview_dontChangeVisibilityTest() {
PeerReview pr = getPeerReview();
pr.setVisibility(Visibility.LIMITED);
activityValidator.validatePeerReview(pr, null, false, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.v3.dev1.record.PeerReview in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validatePeerReview_invalidPutCodeTest.
@Test(expected = InvalidPutCodeException.class)
public void validatePeerReview_invalidPutCodeTest() {
SourceEntity source = mock(SourceEntity.class);
when(source.getSourceName()).thenReturn("source name");
PeerReview pr = getPeerReview();
pr.setPutCode(1L);
activityValidator.validatePeerReview(pr, source, 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_invalidSubjectExternalIdentifiersTest.
@Test(expected = ActivityIdentifierValidationException.class)
public void validatePeerReview_invalidSubjectExternalIdentifiersTest() {
PeerReview pr = getPeerReview();
pr.getSubjectExternalIdentifier().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 MemberV3ApiServiceDelegatorImpl method createPeerReview.
@Override
public Response createPeerReview(String orcid, PeerReview peerReview) {
orcidSecurityManager.checkClientAccessAndScopes(orcid, ScopePathType.PEER_REVIEW_CREATE, ScopePathType.PEER_REVIEW_UPDATE);
clearSource(peerReview);
PeerReview newPeerReview = peerReviewManager.createPeerReview(orcid, peerReview, true);
sourceUtils.setSourceName(newPeerReview);
try {
return Response.created(new URI(String.valueOf(newPeerReview.getPutCode()))).build();
} catch (URISyntaxException ex) {
throw new RuntimeException(localeManager.resolveMessage("apiError.createpeerreview_response.exception"), ex);
}
}
Aggregations