diff --git a/src/test/java/org/jabref/logic/integrity/ASCIICharacterCheckerTest.java b/src/test/java/org/jabref/logic/integrity/ASCIICharacterCheckerTest.java index 09efadebe2d9..44a0d7a4d683 100644 --- a/src/test/java/org/jabref/logic/integrity/ASCIICharacterCheckerTest.java +++ b/src/test/java/org/jabref/logic/integrity/ASCIICharacterCheckerTest.java @@ -18,19 +18,22 @@ public class ASCIICharacterCheckerTest { @Test void fieldAcceptsAsciiCharacters() { entry.setField(StandardField.TITLE, "Only ascii characters!'@12"); - assertEquals(Collections.emptyList(), checker.check(entry)); + assertEquals(Collections.emptyList(), + new FieldChecker(StandardField.TITLE, checker).check(entry)); } @Test void fieldDoesNotAcceptUmlauts() { entry.setField(StandardField.MONTH, "Umlauts are nöt ällowed"); - assertEquals(List.of(new IntegrityMessage("Non-ASCII encoded character found", entry, StandardField.MONTH)), checker.check(entry)); + assertEquals(List.of(new IntegrityMessage("Non-ASCII encoded character found", entry, StandardField.MONTH)), + new FieldChecker(StandardField.MONTH, checker).check(entry)); } @Test void fieldDoesNotAcceptUnicode() { entry.setField(StandardField.AUTHOR, "Some unicode ⊕"); - assertEquals(List.of(new IntegrityMessage("Non-ASCII encoded character found", entry, StandardField.AUTHOR)), checker.check(entry)); + assertEquals(List.of(new IntegrityMessage("Non-ASCII encoded character found", entry, StandardField.AUTHOR)), + new FieldChecker(StandardField.AUTHOR, checker).check(entry)); } @Test @@ -40,13 +43,15 @@ void fieldAcceptsOnlyAsciiCharacters() { field += Character.toString(i); } entry.setField(StandardField.TITLE, field); - assertEquals(Collections.emptyList(), checker.check(entry)); + assertEquals(Collections.emptyList(), + new FieldChecker(StandardField.TITLE, checker).check(entry)); } @Test void fieldDoesNotAcceptNonAsciiCharacters() { String field = Character.toString(31) + Character.toString(128); entry.setField(StandardField.TITLE, field); - assertEquals(List.of(new IntegrityMessage("Non-ASCII encoded character found", entry, StandardField.TITLE)), checker.check(entry)); + assertEquals(List.of(new IntegrityMessage("Non-ASCII encoded character found", entry, StandardField.TITLE)), + new FieldChecker(StandardField.TITLE, checker).check(entry)); } }