Search in sources :

Example 1 with Iso3166Country

use of org.orcid.jaxb.model.v3.dev1.common.Iso3166Country in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method createAddress.

protected Address createAddress(Visibility v, String sourceId) {
    Address a = new Address();
    a.setVisibility(v);
    Iso3166Country[] all = Iso3166Country.values();
    Random r = new Random();
    int index = r.nextInt(all.length);
    if (index < 0 || index >= all.length) {
        index = 0;
    }
    a.setCountry(new Country(all[index]));
    setSource(a, sourceId);
    return a;
}
Also used : Address(org.orcid.jaxb.model.v3.dev1.record.Address) Random(java.util.Random) Country(org.orcid.jaxb.model.v3.dev1.common.Country) Iso3166Country(org.orcid.jaxb.model.v3.dev1.common.Iso3166Country) Iso3166Country(org.orcid.jaxb.model.v3.dev1.common.Iso3166Country)

Example 2 with Iso3166Country

use of org.orcid.jaxb.model.v3.dev1.common.Iso3166Country in project ORCID-Source by ORCID.

the class ActivityValidatorTest method validateWork_emptyCountryTest.

@Test(expected = ActivityTypeValidationException.class)
public void validateWork_emptyCountryTest() {
    Work work = getWork();
    work.getCountry().setValue((Iso3166Country) null);
    activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
Also used : Work(org.orcid.jaxb.model.v3.dev1.record.Work) Test(org.junit.Test)

Example 3 with Iso3166Country

use of org.orcid.jaxb.model.v3.dev1.common.Iso3166Country in project ORCID-Source by ORCID.

the class AddressManagerTest method getAddress.

private Address getAddress(Iso3166Country country) {
    Address address = new Address();
    address.setCountry(new Country(country));
    address.setVisibility(Visibility.PUBLIC);
    return address;
}
Also used : Address(org.orcid.jaxb.model.v3.dev1.record.Address) Iso3166Country(org.orcid.jaxb.model.v3.dev1.common.Iso3166Country) Country(org.orcid.jaxb.model.v3.dev1.common.Country)

Aggregations

Country (org.orcid.jaxb.model.v3.dev1.common.Country)2 Iso3166Country (org.orcid.jaxb.model.v3.dev1.common.Iso3166Country)2 Address (org.orcid.jaxb.model.v3.dev1.record.Address)2 Random (java.util.Random)1 Test (org.junit.Test)1 Work (org.orcid.jaxb.model.v3.dev1.record.Work)1