diff options
author | Niedermann IT-Dienstleistungen <stefan-niedermann@users.noreply.github.com> | 2020-12-27 12:34:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-27 12:34:34 +0300 |
commit | 910710dbfb927e5f31ab9219d7fed98db8f210c7 (patch) | |
tree | 03ca1e35846f632650aa934a88a875e9faa6763a /app/src/main/java/it/niedermann/nextcloud/deck | |
parent | 39cad88b6029b466300d8c3c9e41be1db0f8ed54 (diff) |
Add basic SyncManager unit tests (#778)
* Add basic SyncManager unit test
Signed-off-by: Stefan Niedermann <info@niedermann.it>
* Fix SyncManager unit test
Signed-off-by: Stefan Niedermann <info@niedermann.it>
* Add testReadAccount
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java index eecdf6848..1ba91b9f7 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/SyncManager.java @@ -103,10 +103,14 @@ public class SyncManager { @AnyThread public SyncManager(@NonNull Context context, @Nullable String ssoAccountName) { - appContext = context.getApplicationContext(); - LastSyncUtil.init(appContext); - this.dataBaseAdapter = new DataBaseAdapter(appContext); - this.serverAdapter = new ServerAdapter(appContext, ssoAccountName); + this(context, new DataBaseAdapter(context.getApplicationContext()), new ServerAdapter(context.getApplicationContext(), ssoAccountName)); + LastSyncUtil.init(context.getApplicationContext()); + } + + private SyncManager(@NonNull Context context, @NonNull DataBaseAdapter databaseAdapter, @NonNull ServerAdapter serverAdapter) { + this.appContext = context.getApplicationContext(); + this.dataBaseAdapter = databaseAdapter; + this.serverAdapter = serverAdapter; } @AnyThread |