Search in sources :

Example 66 with Employment

use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.

the class ActivityValidatorTest method validateEmploymentWithoutDisambiguatedOrgId.

@Test(expected = InvalidDisambiguatedOrgException.class)
public void validateEmploymentWithoutDisambiguatedOrgId() {
    Employment e = getEmployment();
    e.getOrganization().getDisambiguatedOrganization().setDisambiguatedOrganizationIdentifier(null);
    activityValidator.validateAffiliation(e, null, false, true, Visibility.PUBLIC);
}
Also used : Employment(org.orcid.jaxb.model.v3.dev1.record.Employment) Test(org.junit.Test)

Example 67 with Employment

use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.

the class ActivityValidatorTest method validateEmployment_validEmploymentTest.

/**
 * VALIDATE AFFILIATIONS
 */
@Test
public void validateEmployment_validEmploymentTest() {
    Employment employment = getEmployment();
    activityValidator.validateAffiliation(employment, null, true, true, Visibility.PUBLIC);
}
Also used : Employment(org.orcid.jaxb.model.v3.dev1.record.Employment) Test(org.junit.Test)

Example 68 with Employment

use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.

the class ActivityValidatorTest method validateEmployment_invalidPutCodeTest.

@Test(expected = InvalidPutCodeException.class)
public void validateEmployment_invalidPutCodeTest() {
    Employment employment = getEmployment();
    employment.setPutCode(1L);
    activityValidator.validateAffiliation(employment, null, true, true, Visibility.PUBLIC);
}
Also used : Employment(org.orcid.jaxb.model.v3.dev1.record.Employment) Test(org.junit.Test)

Example 69 with Employment

use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.

the class ActivityValidatorTest method validateEmploymentWithoutDisambiguatedOrg.

@Test(expected = InvalidDisambiguatedOrgException.class)
public void validateEmploymentWithoutDisambiguatedOrg() {
    Employment e = getEmployment();
    e.getOrganization().setDisambiguatedOrganization(null);
    activityValidator.validateAffiliation(e, null, false, true, Visibility.PUBLIC);
}
Also used : Employment(org.orcid.jaxb.model.v3.dev1.record.Employment) Test(org.junit.Test)

Example 70 with Employment

use of org.orcid.jaxb.model.v3.dev1.record.Employment in project ORCID-Source by ORCID.

the class AffiliationsManagerTest method testAddEmploymentToClaimedRecordPreserveUserDefaultVisibility.

@Test
public void testAddEmploymentToClaimedRecordPreserveUserDefaultVisibility() {
    when(sourceManager.retrieveSourceEntity()).thenReturn(new SourceEntity(new ClientDetailsEntity(CLIENT_1_ID)));
    Employment element = getEmployment();
    element = affiliationsManager.createEmploymentAffiliation(claimedOrcid, element, true);
    element = affiliationsManager.getEmploymentAffiliation(claimedOrcid, element.getPutCode());
    assertNotNull(element);
    assertEquals(Visibility.LIMITED, element.getVisibility());
}
Also used : ClientDetailsEntity(org.orcid.persistence.jpa.entities.ClientDetailsEntity) Employment(org.orcid.jaxb.model.v3.dev1.record.Employment) SourceEntity(org.orcid.persistence.jpa.entities.SourceEntity) Test(org.junit.Test) BaseTest(org.orcid.core.BaseTest)

Aggregations

Employment (org.orcid.jaxb.model.v3.dev1.record.Employment)61 Test (org.junit.Test)53 DBUnitTest (org.orcid.test.DBUnitTest)21 Response (javax.ws.rs.core.Response)20 Affiliation (org.orcid.jaxb.model.v3.dev1.record.Affiliation)18 Education (org.orcid.jaxb.model.v3.dev1.record.Education)13 Distinction (org.orcid.jaxb.model.v3.dev1.record.Distinction)11 Membership (org.orcid.jaxb.model.v3.dev1.record.Membership)11 Service (org.orcid.jaxb.model.v3.dev1.record.Service)11 FuzzyDate (org.orcid.jaxb.model.v3.dev1.common.FuzzyDate)10 InvitedPosition (org.orcid.jaxb.model.v3.dev1.record.InvitedPosition)10 Qualification (org.orcid.jaxb.model.v3.dev1.record.Qualification)10 Day (org.orcid.jaxb.model.v3.dev1.common.Day)8 Month (org.orcid.jaxb.model.v3.dev1.common.Month)8 Year (org.orcid.jaxb.model.v3.dev1.common.Year)8 ResearcherUrl (org.orcid.jaxb.model.v3.dev1.record.ResearcherUrl)8 EmploymentSummary (org.orcid.jaxb.model.v3.dev1.record.summary.EmploymentSummary)8 ActivitiesSummary (org.orcid.jaxb.model.v3.dev1.record.summary.ActivitiesSummary)7 Funding (org.orcid.jaxb.model.v3.dev1.record.Funding)6 Work (org.orcid.jaxb.model.v3.dev1.record.Work)6