Introduce lambdaError instead of using TODO, to handle error when a lambda is invoked and it should not.

This commit is contained in:
Benoit Marty 2024-05-23 09:12:40 +02:00
parent 955b4308ce
commit 4fc3c6f889
21 changed files with 77 additions and 33 deletions

View file

@ -18,10 +18,11 @@ package io.element.android.libraries.pushstore.test.userpushstore.clientsecret
import io.element.android.libraries.matrix.api.core.SessionId
import io.element.android.libraries.pushstore.api.clientsecret.PushClientSecret
import io.element.android.tests.testutils.lambda.lambdaError
class FakePushClientSecret(
private val getSecretForUserResult: (SessionId) -> String = { TODO() },
private val getUserIdFromSecretResult: (String) -> SessionId? = { TODO() }
private val getSecretForUserResult: (SessionId) -> String = { lambdaError() },
private val getUserIdFromSecretResult: (String) -> SessionId? = { lambdaError() }
) : PushClientSecret {
override suspend fun getSecretForUser(userId: SessionId): String {
return getSecretForUserResult(userId)