Search in sources :

Example 6 with Subtitle

use of org.orcid.jaxb.model.common_v2.Subtitle in project ORCID-Source by ORCID.

the class MemberV2ApiServiceDelegator_WorksTest method testCleanEmptyFieldsOnWorks.

@Test
public void testCleanEmptyFieldsOnWorks() {
    LastModifiedDate lmd = new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(System.currentTimeMillis()));
    Work work = new Work();
    work.setLastModifiedDate(lmd);
    work.setWorkCitation(new Citation("", CitationType.FORMATTED_UNSPECIFIED));
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title("My Work"));
    title.setSubtitle(new Subtitle("My subtitle"));
    title.setTranslatedTitle(new TranslatedTitle("", ""));
    work.setWorkTitle(title);
    ActivityUtils.cleanEmptyFields(work);
    assertNotNull(work);
    Utils.verifyLastModified(work.getLastModifiedDate());
    assertNotNull(work.getWorkTitle());
    assertNotNull(work.getWorkTitle().getTitle());
    assertNotNull(work.getWorkTitle().getSubtitle());
    assertEquals("My Work", work.getWorkTitle().getTitle().getContent());
    assertEquals("My subtitle", work.getWorkTitle().getSubtitle().getContent());
    assertNull(work.getWorkCitation());
    assertNull(work.getWorkTitle().getTranslatedTitle());
}
Also used : LastModifiedDate(org.orcid.jaxb.model.common_v2.LastModifiedDate) Subtitle(org.orcid.jaxb.model.common_v2.Subtitle) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) Work(org.orcid.jaxb.model.record_v2.Work) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) Title(org.orcid.jaxb.model.common_v2.Title) Citation(org.orcid.jaxb.model.record_v2.Citation) DBUnitTest(org.orcid.test.DBUnitTest) Test(org.junit.Test)

Example 7 with Subtitle

use of org.orcid.jaxb.model.common_v2.Subtitle in project ORCID-Source by ORCID.

the class ActivityValidatorTest method getWorkTitle.

public WorkTitle getWorkTitle() {
    WorkTitle title = new WorkTitle();
    title.setTitle(new Title("title"));
    title.setSubtitle(new Subtitle("subtitle"));
    title.setTranslatedTitle(new TranslatedTitle("translated title", "en"));
    return title;
}
Also used : Subtitle(org.orcid.jaxb.model.common_v2.Subtitle) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) WorkTitle(org.orcid.jaxb.model.record_v2.WorkTitle) TranslatedTitle(org.orcid.jaxb.model.common_v2.TranslatedTitle) FundingTitle(org.orcid.jaxb.model.record_v2.FundingTitle) Title(org.orcid.jaxb.model.common_v2.Title)

Aggregations

CreatedDate (org.orcid.jaxb.model.common_v2.CreatedDate)4 Subtitle (org.orcid.jaxb.model.common_v2.Subtitle)4 Title (org.orcid.jaxb.model.common_v2.Title)4 Work (org.orcid.jaxb.model.record_v2.Work)4 WorkTitle (org.orcid.jaxb.model.record_v2.WorkTitle)4 FuzzyDate (org.orcid.jaxb.model.common_v2.FuzzyDate)3 LastModifiedDate (org.orcid.jaxb.model.common_v2.LastModifiedDate)3 PublicationDate (org.orcid.jaxb.model.common_v2.PublicationDate)3 TranslatedTitle (org.orcid.jaxb.model.common_v2.TranslatedTitle)3 Url (org.orcid.jaxb.model.common_v2.Url)3 ContributorOrcid (org.orcid.jaxb.model.common_v2.ContributorOrcid)2 Country (org.orcid.jaxb.model.common_v2.Country)2 CreditName (org.orcid.jaxb.model.common_v2.CreditName)2 Day (org.orcid.jaxb.model.common_v2.Day)2 Iso3166Country (org.orcid.jaxb.model.common_v2.Iso3166Country)2 Month (org.orcid.jaxb.model.common_v2.Month)2 Year (org.orcid.jaxb.model.common_v2.Year)2 ExternalID (org.orcid.jaxb.model.record_v2.ExternalID)2 ExternalIDs (org.orcid.jaxb.model.record_v2.ExternalIDs)2 WorkCategory (org.orcid.jaxb.model.record_v2.WorkCategory)2