@Test public void convert_WITH_MINIMAL_REFERENCE() { eu.dnetlib.iis.metadataextraction.schemas.ReferenceMetadata inputReference = eu.dnetlib.iis.metadataextraction.schemas.ReferenceMetadata.newBuilder() .setPosition(4) .setBasicMetadata(eu.dnetlib.iis.metadataextraction.schemas.ReferenceBasicMetadata.newBuilder() .setTitle(null) .setAuthors(null) .setSource(null) .setPages(null) .setYear(null) .build()) .setText(null) .build(); ExtractedDocumentMetadataMergedWithOriginal inputDocument = ExtractedDocumentMetadataMergedWithOriginal.newBuilder() .setId("document-id") .setImportedAuthors(Lists.newArrayList()) .setReferences(Lists.newArrayList(inputReference)) .setPublicationType(new PublicationType(true, false)) .build(); DocumentMetadata retDocumentMetadata = converter.convert(inputDocument, emptyReferencePositions); assertEquals(1, retDocumentMetadata.getReferences().size()); ReferenceMetadata expectedReference = ReferenceMetadata.newBuilder() .setPosition(4) .setBasicMetadata(BasicMetadata.newBuilder() .setTitle(null) .setAuthors(Lists.newArrayList()) .setJournal(null) .setPages(null) .setYear(null) .build()) .setRawText(null) .build(); assertEquals(expectedReference, retDocumentMetadata.getReferences().get(0)); }
public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; } }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }  }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }  DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions); }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }  DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions);  }