From 5f3abb593351801641c5d6f9b0afae4cc2402f7e Mon Sep 17 00:00:00 2001 From: Benedikt Tutzer Date: Wed, 18 Aug 2021 22:17:19 +0200 Subject: [PATCH] Reordered Pdf-Importer priorities (#8001) * Reordered Pdf-Importer priorities * Adapted tests --- .../importer/fileformat/PdfMergeMetadataImporter.java | 4 ++-- .../fileformat/PdfMergeMetadataImporterTest.java | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java index 2d301e70307..961af65fc60 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporter.java @@ -45,10 +45,10 @@ public class PdfMergeMetadataImporter extends Importer { public PdfMergeMetadataImporter(ImportFormatPreferences importFormatPreferences) { this.importFormatPreferences = importFormatPreferences; this.metadataImporters = List.of( - new PdfGrobidImporter(GrobidCitationFetcher.GROBID_URL, importFormatPreferences), + new PdfVerbatimBibTextImporter(importFormatPreferences), new PdfEmbeddedBibFileImporter(importFormatPreferences), + new PdfGrobidImporter(GrobidCitationFetcher.GROBID_URL, importFormatPreferences), new PdfXmpImporter(importFormatPreferences.getXmpPreferences()), - new PdfVerbatimBibTextImporter(importFormatPreferences), new PdfContentImporter(importFormatPreferences) ); } diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java index 2a9bfbadb4e..bbc91cca20e 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java @@ -59,12 +59,11 @@ void importWorksAsExpected() throws Exception { // From DOI (contained in embedded bib file) BibEntry expected = new BibEntry(StandardEntryType.Book); - expected.setCitationKey("Burd_2011"); - expected.setField(StandardField.AUTHOR, "Barry Burd"); - expected.setField(StandardField.TITLE, "Java{\\textregistered} For Dummies{\\textregistered}"); - expected.setField(StandardField.PUBLISHER, "Wiley Publishing, Inc."); - expected.setField(StandardField.YEAR, "2011"); - expected.setField(StandardField.AUTHOR, "Barry Burd"); + expected.setCitationKey("9780134685991"); + expected.setField(StandardField.AUTHOR, "Bloch, Joshua"); + expected.setField(StandardField.TITLE, "Effective Java"); + expected.setField(StandardField.PUBLISHER, "Addison Wesley"); + expected.setField(StandardField.YEAR, "2018"); expected.setField(StandardField.MONTH, "jul"); expected.setField(StandardField.DOI, "10.1002/9781118257517");