diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPushServiceTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPushServiceTest.kt index 3268e51a16..546d69b008 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPushServiceTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPushServiceTest.kt @@ -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) diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPusherSubscriberTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPusherSubscriberTest.kt index 5cb53071e2..dd9363de9e 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPusherSubscriberTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/DefaultPusherSubscriberTest.kt @@ -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( diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/push/DefaultPushHandlerTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/push/DefaultPushHandlerTest.kt index f6ec20d22f..5eaa879429 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/push/DefaultPushHandlerTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/push/DefaultPushHandlerTest.kt @@ -257,7 +257,7 @@ class DefaultPushHandlerTest { incrementPushCounterResult() } }, - userPushStoreFactory = FakeUserPushStoreFactory(userPushStore), + userPushStoreFactory = FakeUserPushStoreFactory { userPushStore }, pushClientSecret = pushClientSecret, buildMeta = buildMeta, matrixAuthenticationService = matrixAuthenticationService, diff --git a/libraries/pushstore/test/src/main/kotlin/io/element/android/libraries/pushstore/test/userpushstore/FakeUserPushStoreFactory.kt b/libraries/pushstore/test/src/main/kotlin/io/element/android/libraries/pushstore/test/userpushstore/FakeUserPushStoreFactory.kt index b3a983122f..14fd4ce3a6 100644 --- a/libraries/pushstore/test/src/main/kotlin/io/element/android/libraries/pushstore/test/userpushstore/FakeUserPushStoreFactory.kt +++ b/libraries/pushstore/test/src/main/kotlin/io/element/android/libraries/pushstore/test/userpushstore/FakeUserPushStoreFactory.kt @@ -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) } }