Move some classes to the test module.

This commit is contained in:
Benoit Marty
2024-05-22 14:41:14 +02:00
parent 84c8a8577b
commit 95507df783
6 changed files with 6 additions and 2 deletions

View File

@@ -58,6 +58,7 @@ dependencies {
testImplementation(libs.test.truth)
testImplementation(libs.test.turbine)
testImplementation(projects.libraries.matrix.test)
testImplementation(projects.libraries.pushstore.test)
testImplementation(projects.tests.testutils)
testImplementation(projects.services.toolbox.test)
testImplementation(projects.services.appnavstate.test)

View File

@@ -1,33 +0,0 @@
/*
* Copyright (c) 2024 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.libraries.pushproviders.unifiedpush
import io.element.android.libraries.matrix.api.core.SessionId
import io.element.android.libraries.pushstore.api.clientsecret.PushClientSecret
class FakePushClientSecret(
private val getSecretForUserResult: (SessionId) -> String = { TODO() },
private val getUserIdFromSecretResult: (String) -> SessionId? = { TODO() }
) : PushClientSecret {
override suspend fun getSecretForUser(userId: SessionId): String {
return getSecretForUserResult(userId)
}
override suspend fun getUserIdFromSecret(clientSecret: String): SessionId? {
return getUserIdFromSecretResult(clientSecret)
}
}

View File

@@ -16,6 +16,7 @@
package io.element.android.libraries.pushproviders.unifiedpush
import com.element.android.libraries.pushstore.test.userpushstore.FakePushClientSecret
import com.google.common.truth.Truth.assertThat
import io.element.android.libraries.matrix.api.MatrixClient
import io.element.android.libraries.matrix.api.core.SessionId