use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_emptyTitleTest.
@Test(expected = ActivityTitleValidationException.class)
public void validateWork_emptyTitleTest() {
Work work = getWork();
work.getWorkTitle().getTitle().setContent(null);
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_invalidPutCodeTest.
@Test(expected = InvalidPutCodeException.class)
public void validateWork_invalidPutCodeTest() {
Work work = getWork();
work.setPutCode(1L);
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_invalidExternalIdentifierTypeTest.
@Test(expected = ActivityIdentifierValidationException.class)
public void validateWork_invalidExternalIdentifierTypeTest() {
Work work = getWork();
work.getExternalIdentifiers().getExternalIdentifier().get(0).setType("invalid");
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateWork_emptyCitationTest.
@Test(expected = OrcidValidationException.class)
public void validateWork_emptyCitationTest() {
Work work = getWork();
work.getWorkCitation().setCitation(null);
activityValidator.validateWork(work, null, true, true, Visibility.PUBLIC);
}
use of org.orcid.jaxb.model.record_rc4.Work in project ORCID-Source by ORCID.
the class BlackBoxBaseRC1 method unmarshallFromPath.
public Object unmarshallFromPath(String path, Class<?> type) {
try (Reader reader = new InputStreamReader(getClass().getResourceAsStream(path))) {
Object obj = unmarshall(reader, type);
Object result = null;
if (Education.class.equals(type)) {
result = (Education) obj;
} else if (Employment.class.equals(type)) {
result = (Employment) obj;
} else if (Funding.class.equals(type)) {
result = (Funding) obj;
} else if (Work.class.equals(type)) {
result = (Work) obj;
} else if (PeerReview.class.equals(type)) {
result = (PeerReview) obj;
}
return result;
} catch (IOException e) {
throw new RuntimeException("Error reading notification from classpath", e);
}
}
Aggregations