use of org.jabref.model.bibtexkeypattern.AbstractBibtexKeyPattern in project jabref by JabRef.
the class BibtexDatabaseWriterTest method writeCustomKeyPattern.
@Test
public void writeCustomKeyPattern() throws Exception {
AbstractBibtexKeyPattern pattern = new DatabaseBibtexKeyPattern(mock(GlobalBibtexKeyPattern.class));
pattern.setDefaultValue("test");
pattern.addBibtexKeyPattern("article", "articleTest");
metaData.setCiteKeyPattern(pattern);
StringSaveSession session = databaseWriter.savePartOfDatabase(bibtexContext, Collections.emptyList(), new SavePreferences());
assertEquals(OS.NEWLINE + "@Comment{jabref-meta: keypattern_article:articleTest;}" + OS.NEWLINE + OS.NEWLINE + "@Comment{jabref-meta: keypatterndefault:test;}" + OS.NEWLINE, session.getStringValue());
}
Aggregations