mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Remove dependency on AppNavigationStateService from DefaultUnifiedPushCurrentUserPushConfigProvider
This commit is contained in:
+4
-4
@@ -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 {
|
||||
|
||||
+3
-3
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user