@Test public void convert_missing_doi() { ImmutableMap<String, String> extIds = ImmutableMap.of("other", "2"); Result sourceDataset = documentEntity(extIds); DataSetReference metadata = converter.convert(sourceDataset); assertNotNull(metadata); assertEquals(ID, metadata.getId()); assertEquals("other", metadata.getReferenceType()); assertEquals("2", metadata.getIdForGivenType()); assertEquals(1, metadata.getCreatorNames().size()); assertEquals(FULL_NAME, metadata.getCreatorNames().get(0)); assertEquals(2, metadata.getTitles().size()); assertEquals(TITLE, metadata.getTitles().get(0)); assertEquals(OTHER_TITLE, metadata.getTitles().get(1)); assertEquals(ABSTRACT, metadata.getDescription()); assertEquals(PUBLISHER, metadata.getPublisher()); assertEquals(YEAR, metadata.getPublicationYear()); assertEquals(1, metadata.getFormats().size()); assertEquals(FORMAT, metadata.getFormats().iterator().next()); assertEquals(RESOURCE_TYPE_CLASSID, metadata.getResourceTypeValue()); assertEquals(1, metadata.getAlternateIdentifiers().size()); assertEquals(extIds, metadata.getAlternateIdentifiers()); }
@Override public DataSetReference convert(Result dataset) { Objects.requireNonNull(dataset); DataSetReference.Builder builder = DataSetReference.newBuilder(); builder.setId(dataset.getId()); createBasicMetadata(dataset, builder); handleAdditionalIds(dataset, builder); handlePersons(dataset, builder); if (builder.getReferenceType() == null) { builder.setReferenceType(REFERENCE_TYPE_UNSPECIFIED); } if (builder.getIdForGivenType() == null) { builder.setIdForGivenType(""); } return builder.build(); }
DatasetMetadataConverter implements OafEntityToAvroConverter<Result, DataSetReference> { @Override public DataSetReference convert(Result dataset) { Objects.requireNonNull(dataset); DataSetReference.Builder builder = DataSetReference.newBuilder(); builder.setId(dataset.getId()); createBasicMetadata(dataset, builder); handleAdditionalIds(dataset, builder); handlePersons(dataset, builder); if (builder.getReferenceType() == null) { builder.setReferenceType(REFERENCE_TYPE_UNSPECIFIED); } if (builder.getIdForGivenType() == null) { builder.setIdForGivenType(""); } return builder.build(); } }
DatasetMetadataConverter implements OafEntityToAvroConverter<Result, DataSetReference> { @Override public DataSetReference convert(Result dataset) { Objects.requireNonNull(dataset); DataSetReference.Builder builder = DataSetReference.newBuilder(); builder.setId(dataset.getId()); createBasicMetadata(dataset, builder); handleAdditionalIds(dataset, builder); handlePersons(dataset, builder); if (builder.getReferenceType() == null) { builder.setReferenceType(REFERENCE_TYPE_UNSPECIFIED); } if (builder.getIdForGivenType() == null) { builder.setIdForGivenType(""); } return builder.build(); } DatasetMetadataConverter(FieldApprover fieldApprover); }
DatasetMetadataConverter implements OafEntityToAvroConverter<Result, DataSetReference> { @Override public DataSetReference convert(Result dataset) { Objects.requireNonNull(dataset); DataSetReference.Builder builder = DataSetReference.newBuilder(); builder.setId(dataset.getId()); createBasicMetadata(dataset, builder); handleAdditionalIds(dataset, builder); handlePersons(dataset, builder); if (builder.getReferenceType() == null) { builder.setReferenceType(REFERENCE_TYPE_UNSPECIFIED); } if (builder.getIdForGivenType() == null) { builder.setIdForGivenType(""); } return builder.build(); } DatasetMetadataConverter(FieldApprover fieldApprover); @Override DataSetReference convert(Result dataset); }
DatasetMetadataConverter implements OafEntityToAvroConverter<Result, DataSetReference> { @Override public DataSetReference convert(Result dataset) { Objects.requireNonNull(dataset); DataSetReference.Builder builder = DataSetReference.newBuilder(); builder.setId(dataset.getId()); createBasicMetadata(dataset, builder); handleAdditionalIds(dataset, builder); handlePersons(dataset, builder); if (builder.getReferenceType() == null) { builder.setReferenceType(REFERENCE_TYPE_UNSPECIFIED); } if (builder.getIdForGivenType() == null) { builder.setIdForGivenType(""); } return builder.build(); } DatasetMetadataConverter(FieldApprover fieldApprover); @Override DataSetReference convert(Result dataset);  }