Skip to content

Commit 7f58df8

Browse files
committed
Fix tests
1 parent aaacdd2 commit 7f58df8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/src/androidTest/kotlin/at/bitfire/davdroid/TestModules.kt

+13
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,24 @@ import at.bitfire.davdroid.push.PushRegistrationWorkerManager
88
import at.bitfire.davdroid.repository.DavCollectionRepository
99
import at.bitfire.davdroid.startup.StartupPlugin
1010
import at.bitfire.davdroid.startup.TasksAppWatcher
11+
import at.bitfire.davdroid.sync.worker.SyncWorkerManager
1112
import dagger.Module
1213
import dagger.hilt.components.SingletonComponent
1314
import dagger.hilt.testing.TestInstallIn
1415
import dagger.multibindings.Multibinds
1516

17+
// remove SyncWorkerModule from Android tests
18+
@Module
19+
@TestInstallIn(
20+
components = [SingletonComponent::class],
21+
replaces = [SyncWorkerManager.SyncWorkerManagerModule::class]
22+
)
23+
abstract class TestSyncWorkerManagerModule {
24+
// provides empty set of listeners
25+
@Multibinds
26+
abstract fun empty(): Set<DavCollectionRepository.OnChangeListener>
27+
}
28+
1629
// remove PushRegistrationWorkerModule from Android tests
1730
@Module
1831
@TestInstallIn(

0 commit comments

Comments
 (0)