use of org.jabref.logic.protectedterms.ProtectedTermsPreferences in project jabref by JabRef.
the class ProtectTermsFormatterTest method setUp.
@Before
public void setUp() {
ProtectTermsFormatter.setProtectedTermsLoader(new ProtectedTermsLoader(new ProtectedTermsPreferences(ProtectedTermsLoader.getInternalLists(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList())));
formatter = new ProtectTermsFormatter();
}
use of org.jabref.logic.protectedterms.ProtectedTermsPreferences 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