@Test public void convert_null_date_of_acceptance() throws IOException { Publication oafEntity = documentEntity(); oafEntity.getDateofacceptance().setValue(null); DocumentMetadata metadata = converter.convert(oafEntity); assertNotNull(metadata); assertEquals(ID, metadata.getId()); assertNull(metadata.getYear()); }
@Override public DocumentMetadata convert(Result result) throws IOException { Preconditions.checkNotNull(result); DocumentMetadata.Builder builder = DocumentMetadata.newBuilder(); builder.setId(result.getId()); createBasicMetadata(result, builder); handleAdditionalIds(result, builder); handleDatasourceIds(result, builder); handlePersons(result, builder); return builder.build(); }
DocumentMetadataConverter implements OafEntityToAvroConverter<Result, DocumentMetadata> { @Override public DocumentMetadata convert(Result result) throws IOException { Preconditions.checkNotNull(result); DocumentMetadata.Builder builder = DocumentMetadata.newBuilder(); builder.setId(result.getId()); createBasicMetadata(result, builder); handleAdditionalIds(result, builder); handleDatasourceIds(result, builder); handlePersons(result, builder); return builder.build(); } }
DocumentMetadataConverter implements OafEntityToAvroConverter<Result, DocumentMetadata> { @Override public DocumentMetadata convert(Result result) throws IOException { Preconditions.checkNotNull(result); DocumentMetadata.Builder builder = DocumentMetadata.newBuilder(); builder.setId(result.getId()); createBasicMetadata(result, builder); handleAdditionalIds(result, builder); handleDatasourceIds(result, builder); handlePersons(result, builder); return builder.build(); } DocumentMetadataConverter(FieldApprover fieldApprover); }
DocumentMetadataConverter implements OafEntityToAvroConverter<Result, DocumentMetadata> { @Override public DocumentMetadata convert(Result result) throws IOException { Preconditions.checkNotNull(result); DocumentMetadata.Builder builder = DocumentMetadata.newBuilder(); builder.setId(result.getId()); createBasicMetadata(result, builder); handleAdditionalIds(result, builder); handleDatasourceIds(result, builder); handlePersons(result, builder); return builder.build(); } DocumentMetadataConverter(FieldApprover fieldApprover); @Override DocumentMetadata convert(Result result); }
DocumentMetadataConverter implements OafEntityToAvroConverter<Result, DocumentMetadata> { @Override public DocumentMetadata convert(Result result) throws IOException { Preconditions.checkNotNull(result); DocumentMetadata.Builder builder = DocumentMetadata.newBuilder(); builder.setId(result.getId()); createBasicMetadata(result, builder); handleAdditionalIds(result, builder); handleDatasourceIds(result, builder); handlePersons(result, builder); return builder.build(); } DocumentMetadataConverter(FieldApprover fieldApprover); @Override DocumentMetadata convert(Result result);  }