mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Change to lambda
This commit is contained in:
+2
-2
@@ -141,7 +141,7 @@ class DefaultPushServiceTest {
|
|||||||
pushProviders = setOf(aCurrentPushProvider, aPushProvider),
|
pushProviders = setOf(aCurrentPushProvider, aPushProvider),
|
||||||
getCurrentPushProvider = FakeGetCurrentPushProvider(currentPushProvider = aCurrentPushProvider.name),
|
getCurrentPushProvider = FakeGetCurrentPushProvider(currentPushProvider = aCurrentPushProvider.name),
|
||||||
userPushStoreFactory = FakeUserPushStoreFactory(
|
userPushStoreFactory = FakeUserPushStoreFactory(
|
||||||
userPushStore = userPushStore,
|
userPushStore = { userPushStore },
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
val result = defaultPushService.registerWith(client, aPushProvider, aDistributor)
|
val result = defaultPushService.registerWith(client, aPushProvider, aDistributor)
|
||||||
@@ -170,7 +170,7 @@ class DefaultPushServiceTest {
|
|||||||
pushProviders = setOf(aCurrentPushProvider, aPushProvider),
|
pushProviders = setOf(aCurrentPushProvider, aPushProvider),
|
||||||
getCurrentPushProvider = FakeGetCurrentPushProvider(currentPushProvider = aCurrentPushProvider.name),
|
getCurrentPushProvider = FakeGetCurrentPushProvider(currentPushProvider = aCurrentPushProvider.name),
|
||||||
userPushStoreFactory = FakeUserPushStoreFactory(
|
userPushStoreFactory = FakeUserPushStoreFactory(
|
||||||
userPushStore = userPushStore,
|
userPushStore = { userPushStore },
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
val result = defaultPushService.registerWith(client, aPushProvider, aDistributor)
|
val result = defaultPushService.registerWith(client, aPushProvider, aDistributor)
|
||||||
|
|||||||
+2
-2
@@ -89,7 +89,7 @@ class DefaultPusherSubscriberTest {
|
|||||||
getSecretForUserResult = { A_SECRET },
|
getSecretForUserResult = { A_SECRET },
|
||||||
),
|
),
|
||||||
userPushStoreFactory = FakeUserPushStoreFactory(
|
userPushStoreFactory = FakeUserPushStoreFactory(
|
||||||
userPushStore = userPushStore,
|
userPushStore = { userPushStore },
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
val result = defaultPusherSubscriber.registerPusher(
|
val result = defaultPusherSubscriber.registerPusher(
|
||||||
@@ -155,7 +155,7 @@ class DefaultPusherSubscriberTest {
|
|||||||
getSecretForUserResult = { A_SECRET },
|
getSecretForUserResult = { A_SECRET },
|
||||||
),
|
),
|
||||||
userPushStoreFactory = FakeUserPushStoreFactory(
|
userPushStoreFactory = FakeUserPushStoreFactory(
|
||||||
userPushStore = userPushStore,
|
userPushStore = { userPushStore },
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
val result = defaultPusherSubscriber.unregisterPusher(
|
val result = defaultPusherSubscriber.unregisterPusher(
|
||||||
|
|||||||
+1
-1
@@ -257,7 +257,7 @@ class DefaultPushHandlerTest {
|
|||||||
incrementPushCounterResult()
|
incrementPushCounterResult()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
userPushStoreFactory = FakeUserPushStoreFactory(userPushStore),
|
userPushStoreFactory = FakeUserPushStoreFactory { userPushStore },
|
||||||
pushClientSecret = pushClientSecret,
|
pushClientSecret = pushClientSecret,
|
||||||
buildMeta = buildMeta,
|
buildMeta = buildMeta,
|
||||||
matrixAuthenticationService = matrixAuthenticationService,
|
matrixAuthenticationService = matrixAuthenticationService,
|
||||||
|
|||||||
+2
-2
@@ -21,9 +21,9 @@ import io.element.android.libraries.pushstore.api.UserPushStore
|
|||||||
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
|
import io.element.android.libraries.pushstore.api.UserPushStoreFactory
|
||||||
|
|
||||||
class FakeUserPushStoreFactory(
|
class FakeUserPushStoreFactory(
|
||||||
val userPushStore: UserPushStore = FakeUserPushStore()
|
val userPushStore: (SessionId) -> UserPushStore = { FakeUserPushStore() }
|
||||||
) : UserPushStoreFactory {
|
) : UserPushStoreFactory {
|
||||||
override fun getOrCreate(userId: SessionId): UserPushStore {
|
override fun getOrCreate(userId: SessionId): UserPushStore {
|
||||||
return userPushStore
|
return userPushStore(userId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user