use of org.orcid.jaxb.model.groupid_v2.GroupIdRecord in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateGroupId_validTest.
/**
* VALIDATE GROUP ID RECORD
* */
@Test
public void validateGroupId_validTest() {
SourceEntity source = mock(SourceEntity.class);
when(source.getSourceName()).thenReturn("source name");
GroupIdRecord g = getGroupIdRecord();
activityValidator.validateGroupIdRecord(g, true, source);
}
use of org.orcid.jaxb.model.groupid_v2.GroupIdRecord in project ORCID-Source by ORCID.
the class Api2_0_rc4_LastModifiedDatesHelper method calculateLastModified.
public static void calculateLastModified(GroupIdRecords groupIdRecords) {
if (groupIdRecords != null && groupIdRecords.getGroupIdRecord() != null && !groupIdRecords.getGroupIdRecord().isEmpty()) {
LastModifiedDate latest = null;
for (GroupIdRecord groupid : groupIdRecords.getGroupIdRecord()) {
if (groupid.getLastModifiedDate() != null && groupid.getLastModifiedDate().after(latest)) {
latest = groupid.getLastModifiedDate();
}
}
groupIdRecords.setLastModifiedDate(latest);
}
}
use of org.orcid.jaxb.model.groupid_v2.GroupIdRecord in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getGroupIdRecordMapperFacade.
public MapperFacade getGroupIdRecordMapperFacade() {
MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
ClassMapBuilder<GroupIdRecord, GroupIdRecordEntity> classMap = mapperFactory.classMap(GroupIdRecord.class, GroupIdRecordEntity.class);
addV2CommonFields(classMap);
registerSourceConverters(mapperFactory, classMap);
classMap.field("name", "groupName");
classMap.field("groupId", "groupId");
classMap.field("description", "groupDescription");
classMap.field("type", "groupType");
classMap.register();
return mapperFactory.getMapperFacade();
}
use of org.orcid.jaxb.model.groupid_v2.GroupIdRecord in project ORCID-Source by ORCID.
the class ActivityValidatorTest method getGroupIdRecord.
public GroupIdRecord getGroupIdRecord() {
GroupIdRecord g = new GroupIdRecord();
g.setDescription("description");
g.setGroupId("orcid-generated:0123456789");
g.setName("group-name");
g.setType("group-type");
return g;
}
use of org.orcid.jaxb.model.groupid_v2.GroupIdRecord in project ORCID-Source by ORCID.
the class ActivityValidatorTest method validateGroupId_invalidGroupIdTest.
@Test(expected = OrcidValidationException.class)
public void validateGroupId_invalidGroupIdTest() {
SourceEntity source = mock(SourceEntity.class);
when(source.getSourceName()).thenReturn("source name");
GroupIdRecord g = getGroupIdRecord();
g.setGroupId("invalid");
activityValidator.validateGroupIdRecord(g, true, source);
}
Aggregations