Update PushProvider API, remove isAvailable(), but instead rely on getDistributors() to eventually return an empty list of Distributors.

This commit is contained in:
Benoit Marty 2024-06-17 17:22:11 +02:00 committed by Benoit Marty
parent 059c0dfe59
commit 90eeb6cdb1
8 changed files with 18 additions and 44 deletions

View file

@ -25,14 +25,12 @@ import io.element.android.tests.testutils.lambda.lambdaError
class FakePushProvider(
override val index: Int = 0,
override val name: String = "aFakePushProvider",
private val isAvailable: Boolean = true,
private val distributors: List<Distributor> = listOf(Distributor("aDistributorValue", "aDistributorName")),
private val currentDistributor: () -> Distributor? = { distributors.firstOrNull() },
private val currentUserPushConfig: CurrentUserPushConfig? = null,
private val registerWithResult: (MatrixClient, Distributor) -> Result<Unit> = { _, _ -> lambdaError() },
private val unregisterWithResult: (MatrixClient) -> Result<Unit> = { lambdaError() },
) : PushProvider {
override fun isAvailable(): Boolean = isAvailable
override fun getDistributors(): List<Distributor> = distributors