mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Move encrypted key, account deletion into AccountManager.
This commit is contained in:
@@ -27,6 +27,7 @@ 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;
|
||||
@@ -53,6 +54,8 @@ public class FeedManagerIntegrationTest extends BriarTestCase {
|
||||
LocalAuthor localAuthor = identityManager.createLocalAuthor("feedTest");
|
||||
identityManager.registerLocalAuthor(localAuthor);
|
||||
|
||||
component.getAccountManager().setDatabaseKey(getSecretKey());
|
||||
|
||||
lifecycleManager = component.getLifecycleManager();
|
||||
lifecycleManager.startServices();
|
||||
lifecycleManager.waitForStartup();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.briarproject.briar.feed;
|
||||
|
||||
import org.briarproject.bramble.account.AccountModule;
|
||||
import org.briarproject.bramble.api.account.AccountManager;
|
||||
import org.briarproject.bramble.api.identity.IdentityManager;
|
||||
import org.briarproject.bramble.api.lifecycle.LifecycleManager;
|
||||
import org.briarproject.bramble.client.ClientModule;
|
||||
@@ -36,6 +38,7 @@ import dagger.Component;
|
||||
TestSecureRandomModule.class,
|
||||
TestSocksModule.class,
|
||||
TestDnsModule.class,
|
||||
AccountModule.class,
|
||||
BriarClientModule.class,
|
||||
ClientModule.class,
|
||||
ContactModule.class,
|
||||
@@ -79,6 +82,8 @@ interface FeedManagerIntegrationTestComponent {
|
||||
|
||||
IdentityManager getIdentityManager();
|
||||
|
||||
AccountManager getAccountManager();
|
||||
|
||||
LifecycleManager getLifecycleManager();
|
||||
|
||||
FeedManager getFeedManager();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.briarproject.briar.introduction;
|
||||
|
||||
import org.briarproject.bramble.account.AccountModule;
|
||||
import org.briarproject.bramble.client.ClientModule;
|
||||
import org.briarproject.bramble.contact.ContactModule;
|
||||
import org.briarproject.bramble.crypto.CryptoExecutorModule;
|
||||
@@ -36,6 +37,7 @@ import dagger.Component;
|
||||
TestDatabaseModule.class,
|
||||
TestPluginConfigModule.class,
|
||||
TestSecureRandomModule.class,
|
||||
AccountModule.class,
|
||||
BlogModule.class,
|
||||
BriarClientModule.class,
|
||||
ClientModule.class,
|
||||
|
||||
@@ -100,6 +100,8 @@ 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);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.briarproject.briar.messaging;
|
||||
|
||||
import org.briarproject.bramble.account.AccountModule;
|
||||
import org.briarproject.bramble.api.account.AccountManager;
|
||||
import org.briarproject.bramble.api.contact.ContactManager;
|
||||
import org.briarproject.bramble.api.event.EventBus;
|
||||
import org.briarproject.bramble.api.identity.IdentityManager;
|
||||
@@ -39,6 +41,7 @@ import dagger.Component;
|
||||
TestDatabaseModule.class,
|
||||
TestPluginConfigModule.class,
|
||||
TestSecureRandomModule.class,
|
||||
AccountModule.class,
|
||||
BriarClientModule.class,
|
||||
ClientModule.class,
|
||||
ContactModule.class,
|
||||
@@ -77,6 +80,8 @@ interface SimplexMessagingIntegrationTestComponent {
|
||||
|
||||
IdentityManager getIdentityManager();
|
||||
|
||||
AccountManager getAccountManager();
|
||||
|
||||
ContactManager getContactManager();
|
||||
|
||||
MessagingManager getMessagingManager();
|
||||
|
||||
@@ -140,6 +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());
|
||||
identityManager0 = c0.getIdentityManager();
|
||||
identityManager1 = c1.getIdentityManager();
|
||||
identityManager2 = c2.getIdentityManager();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.briarproject.briar.test;
|
||||
|
||||
import org.briarproject.bramble.account.AccountModule;
|
||||
import org.briarproject.bramble.api.account.AccountManager;
|
||||
import org.briarproject.bramble.api.client.ClientHelper;
|
||||
import org.briarproject.bramble.api.contact.ContactManager;
|
||||
import org.briarproject.bramble.api.db.DatabaseComponent;
|
||||
@@ -122,6 +123,8 @@ public interface BriarIntegrationTestComponent {
|
||||
|
||||
IdentityManager getIdentityManager();
|
||||
|
||||
AccountManager getAccountManager();
|
||||
|
||||
ClientHelper getClientHelper();
|
||||
|
||||
ContactManager getContactManager();
|
||||
|
||||
Reference in New Issue
Block a user