use of net.viperfish.journal.framework.provider.JournalEncryptionWrapper in project vsDiaryWriter by shilongdai.
the class OperationTest method testChangeConfig.
@Test
public void testChangeConfig() throws FailToSyncEntryException {
cleanUp();
Map<String, String> testConfig = new HashMap<>();
addEntries(10);
testConfig.put("viperfish.secure.encrytion.algorithm", "DES");
testConfig.put(ConfigMapping.DB_COMPONENT, "H2Database");
new ChangeConfigurationOperation(testConfig).execute();
Assert.assertEquals("DES", Configuration.getString("viperfish.secure.encrytion.algorithm"));
Assert.assertEquals("H2Database", Configuration.getString(ConfigMapping.DB_COMPONENT));
initComponents();
Assert.assertEquals(((JournalEncryptionWrapper) db).getDb().getClass(), ((JournalEncryptionWrapper) EntryDatabases.INSTANCE.getEntryDatabase("H2Database")).getDb().getClass());
for (Journal i : db.getAll()) {
Assert.assertEquals("test", i.getContent());
}
setupConfig();
initComponents();
cleanUp();
}
Aggregations