Remove dependency on AppNavigationStateService from DefaultUnifiedPushCurrentUserPushConfigProvider
This commit is contained in:
parent
705b1b08f2
commit
afdfe28ef4
21 changed files with 124 additions and 160 deletions
|
|
@ -9,7 +9,7 @@ package io.element.android.libraries.pushproviders.test
|
|||
|
||||
import io.element.android.libraries.matrix.api.MatrixClient
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
import io.element.android.libraries.pushproviders.api.CurrentUserPushConfig
|
||||
import io.element.android.libraries.pushproviders.api.Config
|
||||
import io.element.android.libraries.pushproviders.api.Distributor
|
||||
import io.element.android.libraries.pushproviders.api.PushProvider
|
||||
import io.element.android.tests.testutils.lambda.lambdaError
|
||||
|
|
@ -21,7 +21,7 @@ class FakePushProvider(
|
|||
private val distributors: List<Distributor> = listOf(Distributor("aDistributorValue", "aDistributorName")),
|
||||
private val currentDistributorValue: () -> String? = { lambdaError() },
|
||||
private val currentDistributor: () -> Distributor? = { distributors.firstOrNull() },
|
||||
private val currentUserPushConfig: CurrentUserPushConfig? = null,
|
||||
private val config: Config? = null,
|
||||
private val registerWithResult: (MatrixClient, Distributor) -> Result<Unit> = { _, _ -> lambdaError() },
|
||||
private val unregisterWithResult: (MatrixClient) -> Result<Unit> = { lambdaError() },
|
||||
private val onSessionDeletedLambda: (SessionId) -> Unit = { lambdaError() },
|
||||
|
|
@ -50,8 +50,8 @@ class FakePushProvider(
|
|||
onSessionDeletedLambda(sessionId)
|
||||
}
|
||||
|
||||
override suspend fun getCurrentUserPushConfig(): CurrentUserPushConfig? {
|
||||
return currentUserPushConfig
|
||||
override suspend fun getPushConfig(sessionId: SessionId): Config? {
|
||||
return config
|
||||
}
|
||||
|
||||
override fun canRotateToken(): Boolean {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
|
||||
package io.element.android.libraries.pushproviders.test
|
||||
|
||||
import io.element.android.libraries.pushproviders.api.CurrentUserPushConfig
|
||||
import io.element.android.libraries.pushproviders.api.Config
|
||||
|
||||
fun aCurrentUserPushConfig(
|
||||
fun aSessionPushConfig(
|
||||
url: String = "aUrl",
|
||||
pushKey: String = "aPushKey",
|
||||
) = CurrentUserPushConfig(
|
||||
) = Config(
|
||||
url = url,
|
||||
pushKey = pushKey,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue