@Test public void when_migrationStarts_should_scopedStorageBeCleared() { storageMigrator.performStorageMigration(); verify(storageEraser).clearOdkDirOnScopedStorage(); }
void performStorageMigration() { storageMigrationRepository.markMigrationStart(); StorageMigrationResult result = migrate(); storageMigrationRepository.setResult(result); storageMigrationRepository.markMigrationEnd(); analytics.logEvent(SCOPED_STORAGE_MIGRATION, result.toString()); }
StorageMigrator { void performStorageMigration() { storageMigrationRepository.markMigrationStart(); StorageMigrationResult result = migrate(); storageMigrationRepository.setResult(result); storageMigrationRepository.markMigrationEnd(); analytics.logEvent(SCOPED_STORAGE_MIGRATION, result.toString()); } }
StorageMigrator { void performStorageMigration() { storageMigrationRepository.markMigrationStart(); StorageMigrationResult result = migrate(); storageMigrationRepository.setResult(result); storageMigrationRepository.markMigrationEnd(); analytics.logEvent(SCOPED_STORAGE_MIGRATION, result.toString()); } StorageMigrator(StoragePathProvider storagePathProvider, StorageStateProvider storageStateProvider,
                           StorageEraser storageEraser, StorageMigrationRepository storageMigrationRepository,
                           GeneralSharedPreferences generalSharedPreferences, ReferenceManager referenceManager,
                           Analytics analytics); }
StorageMigrator { void performStorageMigration() { storageMigrationRepository.markMigrationStart(); StorageMigrationResult result = migrate(); storageMigrationRepository.setResult(result); storageMigrationRepository.markMigrationEnd(); analytics.logEvent(SCOPED_STORAGE_MIGRATION, result.toString()); } StorageMigrator(StoragePathProvider storagePathProvider, StorageStateProvider storageStateProvider,
                           StorageEraser storageEraser, StorageMigrationRepository storageMigrationRepository,
                           GeneralSharedPreferences generalSharedPreferences, ReferenceManager referenceManager,
                           Analytics analytics); StorageMigrationResult migrate(); }
StorageMigrator { void performStorageMigration() { storageMigrationRepository.markMigrationStart(); StorageMigrationResult result = migrate(); storageMigrationRepository.setResult(result); storageMigrationRepository.markMigrationEnd(); analytics.logEvent(SCOPED_STORAGE_MIGRATION, result.toString()); } StorageMigrator(StoragePathProvider storagePathProvider, StorageStateProvider storageStateProvider,
                           StorageEraser storageEraser, StorageMigrationRepository storageMigrationRepository,
                           GeneralSharedPreferences generalSharedPreferences, ReferenceManager referenceManager,
                           Analytics analytics); StorageMigrationResult migrate();  }