@Test public void convert_null_aff_properties() { ExtractedDocumentMetadata document = new ExtractedDocumentMetadata(); document.setId("XYZ"); Affiliation aff1 = createAffiliation(null, null, null); List<Affiliation> affiliations = Lists.newArrayList(aff1); document.setAffiliations(affiliations); document.setAuthors(Lists.newArrayList(createAuthor("author1", 0))); List<AffMatchAffiliation> affMatchAffiliations = converter.convert(document); assertNotNull(affMatchAffiliations); assertAffiliation(affMatchAffiliations.get(0), "XYZ", 1, "", "", ""); }
public List<AffMatchAffiliation> convert(ExtractedDocumentMetadata document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(StringUtils.isNotBlank(document.getId())); List<AffMatchAffiliation> affMatchAffiliations = new ArrayList<>(); if (CollectionUtils.isEmpty(document.getAffiliations())) { return affMatchAffiliations; } for (int i = 0; i < document.getAffiliations().size(); i++) { Affiliation srcAffiliation = document.getAffiliations().get(i); if (isAuthorAffiliation(i, document.getAuthors())) { affMatchAffiliations.add(convertAffiliation(document.getId(), i + 1, srcAffiliation)); } } return affMatchAffiliations; }
AffiliationConverter implements Serializable { public List<AffMatchAffiliation> convert(ExtractedDocumentMetadata document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(StringUtils.isNotBlank(document.getId())); List<AffMatchAffiliation> affMatchAffiliations = new ArrayList<>(); if (CollectionUtils.isEmpty(document.getAffiliations())) { return affMatchAffiliations; } for (int i = 0; i < document.getAffiliations().size(); i++) { Affiliation srcAffiliation = document.getAffiliations().get(i); if (isAuthorAffiliation(i, document.getAuthors())) { affMatchAffiliations.add(convertAffiliation(document.getId(), i + 1, srcAffiliation)); } } return affMatchAffiliations; } }
AffiliationConverter implements Serializable { public List<AffMatchAffiliation> convert(ExtractedDocumentMetadata document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(StringUtils.isNotBlank(document.getId())); List<AffMatchAffiliation> affMatchAffiliations = new ArrayList<>(); if (CollectionUtils.isEmpty(document.getAffiliations())) { return affMatchAffiliations; } for (int i = 0; i < document.getAffiliations().size(); i++) { Affiliation srcAffiliation = document.getAffiliations().get(i); if (isAuthorAffiliation(i, document.getAuthors())) { affMatchAffiliations.add(convertAffiliation(document.getId(), i + 1, srcAffiliation)); } } return affMatchAffiliations; }  }
AffiliationConverter implements Serializable { public List<AffMatchAffiliation> convert(ExtractedDocumentMetadata document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(StringUtils.isNotBlank(document.getId())); List<AffMatchAffiliation> affMatchAffiliations = new ArrayList<>(); if (CollectionUtils.isEmpty(document.getAffiliations())) { return affMatchAffiliations; } for (int i = 0; i < document.getAffiliations().size(); i++) { Affiliation srcAffiliation = document.getAffiliations().get(i); if (isAuthorAffiliation(i, document.getAuthors())) { affMatchAffiliations.add(convertAffiliation(document.getId(), i + 1, srcAffiliation)); } } return affMatchAffiliations; }  List<AffMatchAffiliation> convert(ExtractedDocumentMetadata document); }
AffiliationConverter implements Serializable { public List<AffMatchAffiliation> convert(ExtractedDocumentMetadata document) { Preconditions.checkNotNull(document); Preconditions.checkArgument(StringUtils.isNotBlank(document.getId())); List<AffMatchAffiliation> affMatchAffiliations = new ArrayList<>(); if (CollectionUtils.isEmpty(document.getAffiliations())) { return affMatchAffiliations; } for (int i = 0; i < document.getAffiliations().size(); i++) { Affiliation srcAffiliation = document.getAffiliations().get(i); if (isAuthorAffiliation(i, document.getAuthors())) { affMatchAffiliations.add(convertAffiliation(document.getId(), i + 1, srcAffiliation)); } } return affMatchAffiliations; }  List<AffMatchAffiliation> convert(ExtractedDocumentMetadata document);  }