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 NotificationManagerTest method deriveEmailFriendlyNameTest.
@Test
public void deriveEmailFriendlyNameTest() {
ProfileEntity testProfile = new ProfileEntity("0000-0000-0000-0003");
assertEquals("ORCID Registry User", notificationManager.deriveEmailFriendlyName(testProfile));
testProfile.setRecordNameEntity(new RecordNameEntity());
assertEquals("ORCID Registry User", notificationManager.deriveEmailFriendlyName(testProfile));
testProfile.getRecordNameEntity().setGivenNames("Given Name");
assertEquals("Given Name", notificationManager.deriveEmailFriendlyName(testProfile));
testProfile.getRecordNameEntity().setFamilyName("Family Name");
assertEquals("Given Name Family Name", notificationManager.deriveEmailFriendlyName(testProfile));
testProfile.getRecordNameEntity().setCreditName("Credit Name");
assertEquals("Credit Name", notificationManager.deriveEmailFriendlyName(testProfile));
}
use of org.orcid.persistence.jpa.entities.ProfileEntity in project ORCID-Source by ORCID.
the class OrcidClientCredentialEndPointDelegatorTest method createAuthorizationCode.
private OrcidOauth2AuthoriziationCodeDetail createAuthorizationCode(String value, String clientId, String redirectUri, boolean persistent, String... scopes) {
OrcidOauth2AuthoriziationCodeDetail authorizationCode = new OrcidOauth2AuthoriziationCodeDetail();
authorizationCode.setId(value);
authorizationCode.setApproved(true);
authorizationCode.setScopes(new HashSet<String>(Arrays.asList(scopes)));
authorizationCode.setClientDetailsEntity(new ClientDetailsEntity(clientId));
authorizationCode.setPersistent(persistent);
authorizationCode.setProfileEntity(new ProfileEntity(USER_ORCID));
authorizationCode.setRedirectUri(redirectUri);
authorizationCode.setResourceIds(new HashSet<String>(Arrays.asList("orcid")));
authorizationCode.setAuthenticated(true);
orcidOauth2AuthoriziationCodeDetailDao.persist(authorizationCode);
return authorizationCode;
}
Aggregations