Change to lambda

This commit is contained in:
Benoit Marty
2024-05-22 18:16:53 +02:00
parent c0fccae12e
commit 310c309e1e
4 changed files with 7 additions and 7 deletions

View File

@@ -141,7 +141,7 @@ class DefaultPushServiceTest {
pushProviders = setOf(aCurrentPushProvider, aPushProvider),
getCurrentPushProvider = FakeGetCurrentPushProvider(currentPushProvider = aCurrentPushProvider.name),
userPushStoreFactory = FakeUserPushStoreFactory(
userPushStore = userPushStore,
userPushStore = { userPushStore },
),
)
val result = defaultPushService.registerWith(client, aPushProvider, aDistributor)
@@ -170,7 +170,7 @@ class DefaultPushServiceTest {
pushProviders = setOf(aCurrentPushProvider, aPushProvider),
getCurrentPushProvider = FakeGetCurrentPushProvider(currentPushProvider = aCurrentPushProvider.name),
userPushStoreFactory = FakeUserPushStoreFactory(
userPushStore = userPushStore,
userPushStore = { userPushStore },
),
)
val result = defaultPushService.registerWith(client, aPushProvider, aDistributor)

View File

@@ -89,7 +89,7 @@ class DefaultPusherSubscriberTest {
getSecretForUserResult = { A_SECRET },
),
userPushStoreFactory = FakeUserPushStoreFactory(
userPushStore = userPushStore,
userPushStore = { userPushStore },
),
)
val result = defaultPusherSubscriber.registerPusher(
@@ -155,7 +155,7 @@ class DefaultPusherSubscriberTest {
getSecretForUserResult = { A_SECRET },
),
userPushStoreFactory = FakeUserPushStoreFactory(
userPushStore = userPushStore,
userPushStore = { userPushStore },
),
)
val result = defaultPusherSubscriber.unregisterPusher(

View File

@@ -257,7 +257,7 @@ class DefaultPushHandlerTest {
incrementPushCounterResult()
}
},
userPushStoreFactory = FakeUserPushStoreFactory(userPushStore),
userPushStoreFactory = FakeUserPushStoreFactory { userPushStore },
pushClientSecret = pushClientSecret,
buildMeta = buildMeta,
matrixAuthenticationService = matrixAuthenticationService,

View File

@@ -21,9 +21,9 @@ import io.element.android.libraries.pushstore.api.UserPushStore
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
class FakeUserPushStoreFactory(
val userPushStore: UserPushStore = FakeUserPushStore()
val userPushStore: (SessionId) -> UserPushStore = { FakeUserPushStore() }
) : UserPushStoreFactory {
override fun getOrCreate(userId: SessionId): UserPushStore {
return userPushStore
return userPushStore(userId)
}
}