use of org.orcid.persistence.jpa.entities.ProfileEntity in project ORCID-Source by ORCID.
the class JpaJaxbEducationAdapterTest method getEducationEntity.
private OrgAffiliationRelationEntity getEducationEntity() {
OrgEntity orgEntity = new OrgEntity();
orgEntity.setCity("org:city");
orgEntity.setCountry(org.orcid.jaxb.model.message.Iso3166Country.US);
orgEntity.setName("org:name");
orgEntity.setRegion("org:region");
orgEntity.setUrl("org:url");
orgEntity.setSource(new SourceEntity("APP-000000001"));
OrgAffiliationRelationEntity result = new OrgAffiliationRelationEntity();
result.setAffiliationType(AffiliationType.EDUCATION);
result.setDepartment("education:department");
result.setEndDate(new EndDateEntity(2020, 2, 2));
result.setId(123456L);
result.setOrg(orgEntity);
result.setProfile(new ProfileEntity("0000-0001-0002-0003"));
result.setStartDate(new StartDateEntity(2000, 1, 1));
result.setTitle("education:title");
result.setVisibility(Visibility.PRIVATE);
result.setClientSourceId("APP-000000001");
return result;
}
use of org.orcid.persistence.jpa.entities.ProfileEntity in project ORCID-Source by ORCID.
the class JpaJaxbEmailAdapterTest method getEmailEntity.
private EmailEntity getEmailEntity() {
EmailEntity result = new EmailEntity();
result.setId("email@test.orcid.org");
result.setCurrent(true);
result.setPrimary(true);
result.setProfile(new ProfileEntity("0000-0000-0000-0000"));
result.setVerified(true);
result.setDateCreated(new Date());
result.setLastModified(new Date());
result.setVisibility(org.orcid.jaxb.model.common_v2.Visibility.PRIVATE);
result.setClientSourceId("APP-000000001");
return result;
}
use of org.orcid.persistence.jpa.entities.ProfileEntity in project ORCID-Source by ORCID.
the class JpaJaxbEmploymentAdapterTest method getEmploymentEntity.
private OrgAffiliationRelationEntity getEmploymentEntity() {
OrgEntity orgEntity = new OrgEntity();
orgEntity.setCity("org:city");
orgEntity.setCountry(org.orcid.jaxb.model.message.Iso3166Country.US);
orgEntity.setName("org:name");
orgEntity.setRegion("org:region");
orgEntity.setUrl("org:url");
orgEntity.setSource(new SourceEntity("APP-000000001"));
OrgAffiliationRelationEntity result = new OrgAffiliationRelationEntity();
result.setAffiliationType(AffiliationType.EMPLOYMENT);
result.setDepartment("employment:department");
result.setEndDate(new EndDateEntity(2020, 2, 2));
result.setId(123456L);
result.setOrg(orgEntity);
result.setProfile(new ProfileEntity("0000-0001-0002-0003"));
result.setStartDate(new StartDateEntity(2000, 1, 1));
result.setTitle("employment:title");
result.setVisibility(Visibility.PRIVATE);
result.setClientSourceId("APP-000000001");
return result;
}
use of org.orcid.persistence.jpa.entities.ProfileEntity in project ORCID-Source by ORCID.
the class SourceInActivitiesTest method sourceDoesntChange_PeerReview_Test.
@Test
public void sourceDoesntChange_PeerReview_Test() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ProfileEntity(userOrcid)));
PeerReview peerReview1 = getPeerReview(userOrcid);
assertNotNull(peerReview1);
assertNotNull(peerReview1.getSubjectName());
assertNotNull(peerReview1.getSubjectName().getTitle());
assertFalse(PojoUtil.isEmpty(peerReview1.getSubjectName().getTitle().getContent()));
assertEquals(userOrcid, peerReview1.retrieveSourcePath());
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
PeerReview peerReview2 = getPeerReview(userOrcid);
assertNotNull(peerReview2);
assertNotNull(peerReview2.getSubjectName());
assertNotNull(peerReview2.getSubjectName().getTitle());
assertFalse(PojoUtil.isEmpty(peerReview2.getSubjectName().getTitle().getContent()));
assertEquals(CLIENT_1_ID, peerReview2.retrieveSourcePath());
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_2_ID)));
PeerReview peerReview3 = getPeerReview(userOrcid);
assertNotNull(peerReview3);
assertNotNull(peerReview3.getSubjectName());
assertNotNull(peerReview3.getSubjectName().getTitle());
assertFalse(PojoUtil.isEmpty(peerReview3.getSubjectName().getTitle().getContent()));
assertEquals(CLIENT_2_ID, peerReview3.retrieveSourcePath());
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ProfileEntity(userOrcid)));
PeerReview peerReview4 = getPeerReview(userOrcid);
assertNotNull(peerReview4);
assertNotNull(peerReview4.getSubjectName());
assertNotNull(peerReview4.getSubjectName().getTitle());
assertFalse(PojoUtil.isEmpty(peerReview4.getSubjectName().getTitle().getContent()));
assertEquals(userOrcid, peerReview4.retrieveSourcePath());
PeerReview fromDb1 = peerReviewManager.getPeerReview(userOrcid, peerReview1.getPutCode());
assertNotNull(fromDb1);
assertEquals(userOrcid, fromDb1.retrieveSourcePath());
PeerReview fromDb2 = peerReviewManager.getPeerReview(userOrcid, peerReview2.getPutCode());
assertNotNull(fromDb2);
assertEquals(CLIENT_1_ID, fromDb2.retrieveSourcePath());
PeerReview fromDb3 = peerReviewManager.getPeerReview(userOrcid, peerReview3.getPutCode());
assertNotNull(fromDb3);
assertEquals(CLIENT_2_ID, fromDb3.retrieveSourcePath());
PeerReview fromDb4 = peerReviewManager.getPeerReview(userOrcid, peerReview4.getPutCode());
assertNotNull(fromDb4);
assertEquals(userOrcid, fromDb4.retrieveSourcePath());
}
use of org.orcid.persistence.jpa.entities.ProfileEntity in project ORCID-Source by ORCID.
the class SourceInActivitiesTest method sourceDoesntChange_Funding_Test.
@Test
@Transactional
public void sourceDoesntChange_Funding_Test() {
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ProfileEntity(userOrcid)));
Funding funding1 = getFunding(userOrcid);
assertNotNull(funding1);
assertNotNull(funding1.getTitle());
assertNotNull(funding1.getTitle().getTitle());
assertFalse(PojoUtil.isEmpty(funding1.getTitle().getTitle().getContent()));
assertEquals(userOrcid, funding1.getSource().retrieveSourcePath());
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
Funding funding2 = getFunding(userOrcid);
assertNotNull(funding2.getTitle());
assertNotNull(funding2.getTitle().getTitle());
assertFalse(PojoUtil.isEmpty(funding2.getTitle().getTitle().getContent()));
assertEquals(CLIENT_1_ID, funding2.getSource().retrieveSourcePath());
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_2_ID)));
Funding funding3 = getFunding(userOrcid);
assertNotNull(funding3.getTitle());
assertNotNull(funding3.getTitle().getTitle());
assertFalse(PojoUtil.isEmpty(funding3.getTitle().getTitle().getContent()));
assertEquals(CLIENT_2_ID, funding3.getSource().retrieveSourcePath());
when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ProfileEntity(userOrcid)));
Funding funding4 = getFunding(userOrcid);
assertNotNull(funding4.getTitle());
assertNotNull(funding4.getTitle().getTitle());
assertFalse(PojoUtil.isEmpty(funding4.getTitle().getTitle().getContent()));
assertEquals(userOrcid, funding4.getSource().retrieveSourcePath());
Funding fromDb1 = profileFundingManager.getFunding(userOrcid, funding1.getPutCode());
assertNotNull(fromDb1);
assertEquals(userOrcid, fromDb1.getSource().retrieveSourcePath());
Funding fromDb2 = profileFundingManager.getFunding(userOrcid, funding2.getPutCode());
assertNotNull(fromDb2);
assertEquals(CLIENT_1_ID, fromDb2.getSource().retrieveSourcePath());
Funding fromDb3 = profileFundingManager.getFunding(userOrcid, funding3.getPutCode());
assertNotNull(fromDb3);
assertEquals(CLIENT_2_ID, fromDb3.getSource().retrieveSourcePath());
Funding fromDb4 = profileFundingManager.getFunding(userOrcid, funding4.getPutCode());
assertNotNull(fromDb4);
assertEquals(userOrcid, fromDb4.getSource().retrieveSourcePath());
}
Aggregations