use of org.orcid.jaxb.model.message.GivenPermissionTo in project ORCID-Source by ORCID.
the class OrcidProfileManagerImplTest method testRevokeDelegate.
@Test
@Transactional
@Rollback(true)
public void testRevokeDelegate() {
OrcidProfile profile1 = createBasicProfile();
Delegation delegation = new Delegation();
profile1.getOrcidBio().setDelegation(delegation);
GivenPermissionTo givenPermissionTo = new GivenPermissionTo();
delegation.setGivenPermissionTo(givenPermissionTo);
DelegationDetails delegationDetails = new DelegationDetails();
delegationDetails.setApprovalDate(new ApprovalDate(DateUtils.convertToXMLGregorianCalendar("2011-03-14T02:34:16")));
DelegateSummary profileSummary = new DelegateSummary(new OrcidIdentifier(DELEGATE_ORCID));
delegationDetails.setDelegateSummary(profileSummary);
givenPermissionTo.getDelegationDetails().add(delegationDetails);
orcidProfileManager.createOrcidProfile(profile1, false, false);
orcidProfileManager.revokeDelegate(TEST_ORCID, DELEGATE_ORCID);
OrcidProfile retrievedProfile = orcidProfileManager.retrieveOrcidProfile(TEST_ORCID);
assertNull(retrievedProfile.getOrcidBio().getDelegation());
}
use of org.orcid.jaxb.model.message.GivenPermissionTo in project ORCID-Source by ORCID.
the class AddDelegateForm method getOrcidProfile.
public OrcidProfile getOrcidProfile(String orcid) {
OrcidProfile orcidProfile = new OrcidProfile();
orcidProfile.setOrcidIdentifier(orcid);
OrcidBio orcidBio = new OrcidBio();
orcidProfile.setOrcidBio(orcidBio);
Delegation delegation = new Delegation();
orcidBio.setDelegation(delegation);
GivenPermissionTo givenPermissionTo = new GivenPermissionTo();
delegation.setGivenPermissionTo(givenPermissionTo);
DelegationDetails delegationDetails = new DelegationDetails();
givenPermissionTo.getDelegationDetails().add(delegationDetails);
DelegateSummary delegateSummary = new DelegateSummary(new OrcidIdentifier(delegateOrcid));
delegationDetails.setDelegateSummary(delegateSummary);
return orcidProfile;
}
Aggregations