use of org.orcid.persistence.jpa.entities.ExternalIdentifierEntity in project ORCID-Source by ORCID.
the class JpaJaxbExternalIdentifierAdapterTest method getExternalIdentifierEntity.
private ExternalIdentifierEntity getExternalIdentifierEntity() {
ExternalIdentifierEntity entity = new ExternalIdentifierEntity();
entity.setDateCreated(new Date());
entity.setLastModified(new Date());
entity.setExternalIdCommonName("common-name");
entity.setExternalIdReference("id-reference");
entity.setExternalIdUrl("http://myurl.com");
entity.setId(123L);
entity.setClientSourceId("APP-0000000000000000");
entity.setVisibility(Visibility.LIMITED);
return entity;
}
use of org.orcid.persistence.jpa.entities.ExternalIdentifierEntity in project ORCID-Source by ORCID.
the class JpaJaxbExternalIdentifierAdapterTest method fromExternalIdentifierEntityToExternalIdentifier.
@Test
public void fromExternalIdentifierEntityToExternalIdentifier() {
ExternalIdentifierEntity entity = getExternalIdentifierEntity();
PersonExternalIdentifier extId = jpaJaxbExternalIdentifierAdapter.toExternalIdentifier(entity);
assertNotNull(extId);
assertNotNull(extId.getCreatedDate());
assertNotNull(extId.getCreatedDate().getValue());
assertNotNull(extId.getLastModifiedDate());
assertNotNull(extId.getLastModifiedDate().getValue());
assertEquals("common-name", extId.getType());
assertEquals("id-reference", extId.getValue());
assertNotNull(extId.getUrl());
assertEquals("http://myurl.com", extId.getUrl().getValue());
assertEquals(Long.valueOf(123), extId.getPutCode());
assertNotNull(extId.getSource());
assertEquals("APP-0000000000000000", extId.getSource().retrieveSourcePath());
assertEquals(Visibility.LIMITED.value(), extId.getVisibility().value());
assertNotNull(extId.getCreatedDate());
assertNotNull(extId.getLastModifiedDate());
}
Aggregations