use of org.jabref.logic.formatter.casechanger.ProtectTermsFormatter in project jabref by JabRef.
the class CleanupWorkerTest method cleanupCasesAddsBracketAroundAluminiumGalliumArsenid.
@Test
public void cleanupCasesAddsBracketAroundAluminiumGalliumArsenid() {
ProtectedTermsLoader protectedTermsLoader = new ProtectedTermsLoader(new ProtectedTermsPreferences(ProtectedTermsLoader.getInternalLists(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList()));
Assert.assertNotEquals(Collections.emptyList(), protectedTermsLoader.getProtectedTerms());
CleanupPreset preset = new CleanupPreset(new FieldFormatterCleanups(true, Collections.singletonList(new FieldFormatterCleanup("title", new ProtectTermsFormatter(protectedTermsLoader)))));
BibEntry entry = new BibEntry();
entry.setField("title", "AlGaAs");
worker.cleanup(preset, entry);
Assert.assertEquals(Optional.of("{AlGaAs}"), entry.getField("title"));
}
Aggregations