Add test for push distributor change.

This commit is contained in:
Benoit Marty 2024-05-17 18:10:12 +02:00 committed by Benoit Marty
parent 1a6b042978
commit 3ace9aa160
4 changed files with 102 additions and 7 deletions

View file

@ -25,7 +25,7 @@ class FakePushProvider(
override val index: Int = 0,
override val name: String = "aFakePushProvider",
private val isAvailable: Boolean = true,
private val distributors: List<Distributor> = emptyList()
private val distributors: List<Distributor> = listOf(Distributor("aDistributorValue", "aDistributorName")),
) : PushProvider {
override fun isAvailable(): Boolean = isAvailable
@ -36,7 +36,7 @@ class FakePushProvider(
}
override suspend fun getCurrentDistributor(matrixClient: MatrixClient): Distributor? {
return null
return distributors.firstOrNull()
}
override suspend fun unregister(matrixClient: MatrixClient): Result<Unit> {