Move DB key management into account manager.

This commit is contained in:
akwizgran
2018-07-27 11:35:27 +01:00
parent 4a9977fa58
commit 6ca0339da2
13 changed files with 123 additions and 166 deletions

View File

@@ -27,7 +27,6 @@ import org.junit.Test;
import java.io.File;
import java.util.Collection;
import static org.briarproject.bramble.test.TestUtils.getSecretKey;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -54,7 +53,7 @@ public class FeedManagerIntegrationTest extends BriarTestCase {
LocalAuthor localAuthor = identityManager.createLocalAuthor("feedTest");
identityManager.registerLocalAuthor(localAuthor);
component.getAccountManager().setDatabaseKey(getSecretKey());
component.getAccountManager().createAccount("password");
lifecycleManager = component.getLifecycleManager();
lifecycleManager.startServices();

View File

@@ -100,11 +100,11 @@ public class SimplexMessagingIntegrationTest extends BriarTestCase {
private ContactId setUp(SimplexMessagingIntegrationTestComponent device,
LocalAuthor local, Author remote, boolean alice) throws Exception {
// Create a database key
device.getAccountManager().setDatabaseKey(getSecretKey());
// Add an identity for the user
IdentityManager identityManager = device.getIdentityManager();
identityManager.registerLocalAuthor(local);
// Create an account
device.getAccountManager().createAccount("password");
// Start the lifecycle manager
LifecycleManager lifecycleManager = device.getLifecycleManager();
lifecycleManager.startServices();

View File

@@ -140,9 +140,9 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
assertTrue(testDir.mkdirs());
createComponents();
c0.getAccountManager().setDatabaseKey(getSecretKey());
c1.getAccountManager().setDatabaseKey(getSecretKey());
c2.getAccountManager().setDatabaseKey(getSecretKey());
c0.getAccountManager().createAccount("password");
c1.getAccountManager().createAccount("password");
c2.getAccountManager().createAccount("password");
identityManager0 = c0.getIdentityManager();
identityManager1 = c1.getIdentityManager();
identityManager2 = c2.getIdentityManager();