Rename class (code quality)

This commit is contained in:
Benoit Marty 2024-05-23 14:42:00 +02:00
parent 6f44ef7a8f
commit 7911fda1fa
13 changed files with 61 additions and 61 deletions

View file

@ -31,7 +31,7 @@ import kotlinx.coroutines.flow.flowOf
val A_OIDC_DATA = OidcDetails(url = "a-url")
class FakeAuthenticationService(
class FakeMatrixAuthenticationService(
private val matrixClientResult: ((SessionId) -> Result<MatrixClient>)? = null
) : MatrixAuthenticationService {
private val homeserver = MutableStateFlow<MatrixHomeServerDetails?>(null)

View file

@ -28,7 +28,7 @@ import io.element.android.libraries.matrix.test.AN_EVENT_ID
import io.element.android.libraries.matrix.test.A_ROOM_ID
import io.element.android.libraries.matrix.test.A_SECRET
import io.element.android.libraries.matrix.test.A_USER_ID
import io.element.android.libraries.matrix.test.auth.FakeAuthenticationService
import io.element.android.libraries.matrix.test.auth.FakeMatrixAuthenticationService
import io.element.android.libraries.matrix.test.core.aBuildMeta
import io.element.android.libraries.push.impl.notifications.FakeNotifiableEventResolver
import io.element.android.libraries.push.impl.notifications.fixtures.aNotifiableMessageEvent
@ -135,7 +135,7 @@ class DefaultPushHandlerTest {
pushClientSecret = FakePushClientSecret(
getUserIdFromSecretResult = { null }
),
matrixAuthenticationService = FakeAuthenticationService().apply {
matrixAuthenticationService = FakeMatrixAuthenticationService().apply {
getLatestSessionIdLambda = { A_USER_ID }
},
incrementPushCounterResult = incrementPushCounterResult
@ -171,7 +171,7 @@ class DefaultPushHandlerTest {
pushClientSecret = FakePushClientSecret(
getUserIdFromSecretResult = { null }
),
matrixAuthenticationService = FakeAuthenticationService().apply {
matrixAuthenticationService = FakeMatrixAuthenticationService().apply {
getLatestSessionIdLambda = { null }
},
incrementPushCounterResult = incrementPushCounterResult
@ -247,7 +247,7 @@ class DefaultPushHandlerTest {
userPushStore: UserPushStore = FakeUserPushStore(),
pushClientSecret: PushClientSecret = FakePushClientSecret(),
buildMeta: BuildMeta = aBuildMeta(),
matrixAuthenticationService: MatrixAuthenticationService = FakeAuthenticationService(),
matrixAuthenticationService: MatrixAuthenticationService = FakeMatrixAuthenticationService(),
diagnosticPushHandler: DiagnosticPushHandler = DiagnosticPushHandler(),
): DefaultPushHandler {
return DefaultPushHandler(

View file

@ -25,7 +25,7 @@ import io.element.android.libraries.matrix.test.A_USER_ID
import io.element.android.libraries.matrix.test.A_USER_ID_2
import io.element.android.libraries.matrix.test.A_USER_ID_3
import io.element.android.libraries.matrix.test.FakeMatrixClient
import io.element.android.libraries.matrix.test.auth.FakeAuthenticationService
import io.element.android.libraries.matrix.test.auth.FakeMatrixAuthenticationService
import io.element.android.libraries.push.test.FakePusherSubscriber
import io.element.android.libraries.pushproviders.api.PusherSubscriber
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
@ -66,7 +66,7 @@ class DefaultFirebaseNewTokenHandlerTest {
storeData(aSessionData(A_USER_ID_2))
storeData(aSessionData(A_USER_ID_3))
},
matrixAuthenticationService = FakeAuthenticationService(
matrixAuthenticationService = FakeMatrixAuthenticationService(
matrixClientResult = { sessionId ->
when (sessionId) {
A_USER_ID -> Result.success(aMatrixClient1)
@ -105,7 +105,7 @@ class DefaultFirebaseNewTokenHandlerTest {
sessionStore = InMemoryMultiSessionsStore().apply {
storeData(aSessionData(A_USER_ID))
},
matrixAuthenticationService = FakeAuthenticationService(
matrixAuthenticationService = FakeMatrixAuthenticationService(
matrixClientResult = { _ ->
Result.failure(IllegalStateException())
}
@ -131,7 +131,7 @@ class DefaultFirebaseNewTokenHandlerTest {
sessionStore = InMemoryMultiSessionsStore().apply {
storeData(aSessionData(A_USER_ID))
},
matrixAuthenticationService = FakeAuthenticationService(
matrixAuthenticationService = FakeMatrixAuthenticationService(
matrixClientResult = { _ ->
Result.success(aMatrixClient1)
}
@ -154,7 +154,7 @@ class DefaultFirebaseNewTokenHandlerTest {
pusherSubscriber: PusherSubscriber = FakePusherSubscriber(),
sessionStore: SessionStore = InMemorySessionStore(),
userPushStoreFactory: UserPushStoreFactory = FakeUserPushStoreFactory(),
matrixAuthenticationService: MatrixAuthenticationService = FakeAuthenticationService(),
matrixAuthenticationService: MatrixAuthenticationService = FakeMatrixAuthenticationService(),
firebaseStore: FirebaseStore = InMemoryFirebaseStore(),
): FirebaseNewTokenHandler {
return DefaultFirebaseNewTokenHandler(

View file

@ -22,7 +22,7 @@ import io.element.android.libraries.matrix.api.auth.MatrixAuthenticationService
import io.element.android.libraries.matrix.test.A_SECRET
import io.element.android.libraries.matrix.test.A_USER_ID
import io.element.android.libraries.matrix.test.FakeMatrixClient
import io.element.android.libraries.matrix.test.auth.FakeAuthenticationService
import io.element.android.libraries.matrix.test.auth.FakeMatrixAuthenticationService
import io.element.android.libraries.push.test.FakePusherSubscriber
import io.element.android.libraries.pushproviders.api.PusherSubscriber
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
@ -86,7 +86,7 @@ class DefaultUnifiedPushNewGatewayHandlerTest {
pusherSubscriber = FakePusherSubscriber(
registerPusherResult = { _, _, _ -> Result.failure(IllegalStateException("an error")) }
),
matrixAuthenticationService = FakeAuthenticationService(matrixClientResult = { Result.success(aMatrixClient) }),
matrixAuthenticationService = FakeMatrixAuthenticationService(matrixClientResult = { Result.success(aMatrixClient) }),
)
val result = defaultUnifiedPushNewGatewayHandler.handle(
endpoint = "aEndpoint",
@ -114,7 +114,7 @@ class DefaultUnifiedPushNewGatewayHandlerTest {
pusherSubscriber = FakePusherSubscriber(
registerPusherResult = lambda
),
matrixAuthenticationService = FakeAuthenticationService(matrixClientResult = { Result.success(aMatrixClient) }),
matrixAuthenticationService = FakeMatrixAuthenticationService(matrixClientResult = { Result.success(aMatrixClient) }),
)
val result = defaultUnifiedPushNewGatewayHandler.handle(
endpoint = "aEndpoint",
@ -131,7 +131,7 @@ class DefaultUnifiedPushNewGatewayHandlerTest {
pusherSubscriber: PusherSubscriber = FakePusherSubscriber(),
userPushStoreFactory: UserPushStoreFactory = FakeUserPushStoreFactory(),
pushClientSecret: PushClientSecret = FakePushClientSecret(),
matrixAuthenticationService: MatrixAuthenticationService = FakeAuthenticationService()
matrixAuthenticationService: MatrixAuthenticationService = FakeMatrixAuthenticationService()
): DefaultUnifiedPushNewGatewayHandler {
return DefaultUnifiedPushNewGatewayHandler(
pusherSubscriber = pusherSubscriber,