Add quick fix in notification troubleshot test to perform a Firebase token rotation

This commit is contained in:
Benoit Marty 2024-10-30 09:39:44 +01:00 committed by Benoit Marty
parent 1f60509d92
commit a6fdb90838
12 changed files with 243 additions and 33 deletions

View file

@ -21,6 +21,8 @@ class FakePushProvider(
private val currentUserPushConfig: CurrentUserPushConfig? = null,
private val registerWithResult: (MatrixClient, Distributor) -> Result<Unit> = { _, _ -> lambdaError() },
private val unregisterWithResult: (MatrixClient) -> Result<Unit> = { lambdaError() },
private val canRotateTokenResult: () -> Boolean = { lambdaError() },
private val rotateTokenLambda: () -> Result<Unit> = { lambdaError() },
) : PushProvider {
override fun getDistributors(): List<Distributor> = distributors
@ -39,4 +41,12 @@ class FakePushProvider(
override suspend fun getCurrentUserPushConfig(): CurrentUserPushConfig? {
return currentUserPushConfig
}
override fun canRotateToken(): Boolean {
return canRotateTokenResult()
}
override suspend fun rotateToken(): Result<Unit> {
return rotateTokenLambda()
}
}