mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-27 11:28:33 +03:00
Removes HomeServerConnectionConfigFixture
This commit is contained in:
parent
2d07b80ace
commit
7896bf9023
4 changed files with 5 additions and 57 deletions
|
@ -19,13 +19,13 @@ package org.matrix.android.sdk.internal.auth
|
|||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.runBlockingTest
|
||||
import org.junit.Test
|
||||
import org.matrix.android.sdk.api.auth.data.HomeServerConnectionConfig
|
||||
import org.matrix.android.sdk.internal.auth.login.LoginType
|
||||
import org.matrix.android.sdk.test.fakes.internal.FakeSessionManager
|
||||
import org.matrix.android.sdk.test.fakes.internal.auth.FakePendingSessionStore
|
||||
import org.matrix.android.sdk.test.fakes.internal.auth.FakeSessionParamsCreator
|
||||
import org.matrix.android.sdk.test.fakes.internal.auth.FakeSessionParamsStore
|
||||
import org.matrix.android.sdk.test.fixtures.CredentialsFixture.aCredentials
|
||||
import org.matrix.android.sdk.test.fixtures.HomeServerConnectionConfigFixture.aHomeServerConnectionConfig
|
||||
import org.matrix.android.sdk.test.fixtures.SessionParamsFixture.aSessionParams
|
||||
|
||||
@ExperimentalCoroutinesApi
|
||||
|
@ -56,6 +56,6 @@ class DefaultSessionCreatorTest {
|
|||
companion object {
|
||||
private val sessionParams = aSessionParams()
|
||||
private val credentials = aCredentials()
|
||||
private val homeServerConnectionConfig = aHomeServerConnectionConfig()
|
||||
private val homeServerConnectionConfig = HomeServerConnectionConfig.Builder().withHomeServerUri("homeserver").build()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ package org.matrix.android.sdk.internal.auth
|
|||
import android.net.Uri
|
||||
import org.amshove.kluent.shouldBeEqualTo
|
||||
import org.matrix.android.sdk.api.auth.data.DiscoveryInformation
|
||||
import org.matrix.android.sdk.api.auth.data.HomeServerConnectionConfig
|
||||
import org.matrix.android.sdk.api.auth.data.SessionParams
|
||||
import org.matrix.android.sdk.internal.auth.login.LoginType
|
||||
import org.matrix.android.sdk.test.fixtures.CredentialsFixture.aCredentials
|
||||
import org.matrix.android.sdk.test.fixtures.DiscoveryInformationFixture.aDiscoveryInformation
|
||||
import org.matrix.android.sdk.test.fixtures.HomeServerConnectionConfigFixture.aHomeServerConnectionConfig
|
||||
import org.matrix.android.sdk.test.fixtures.WellKnownBaseConfigFixture.aWellKnownBaseConfig
|
||||
|
||||
abstract class DefaultSessionParamsCreatorTestBase {
|
||||
|
@ -33,7 +33,7 @@ abstract class DefaultSessionParamsCreatorTestBase {
|
|||
protected val credentials = aCredentials()
|
||||
protected val credentialsWithHomeServer = aCredentials(discoveryInformation = discoveryWithHomeServer)
|
||||
protected val credentialsWithIdentityServer = aCredentials(discoveryInformation = discoveryWithIdentityServer)
|
||||
protected val homeServerConnectionConfig = aHomeServerConnectionConfig()
|
||||
protected val homeServerConnectionConfig = HomeServerConnectionConfig.Builder().withHomeServerUri("homeserver").build()
|
||||
|
||||
protected fun assertExpectedSessionParams(sessionParams: SessionParams) {
|
||||
sessionParams shouldBeEqualTo SessionParams(
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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 org.matrix.android.sdk.test.fixtures
|
||||
|
||||
import android.net.Uri
|
||||
import okhttp3.CipherSuite
|
||||
import okhttp3.TlsVersion
|
||||
import org.matrix.android.sdk.api.auth.data.HomeServerConnectionConfig
|
||||
import org.matrix.android.sdk.internal.network.ssl.Fingerprint
|
||||
|
||||
object HomeServerConnectionConfigFixture {
|
||||
fun aHomeServerConnectionConfig(
|
||||
homeServerUri: Uri = Uri.parse("aUri"),
|
||||
homeServerUriBase: Uri = homeServerUri,
|
||||
identityServerUri: Uri? = null,
|
||||
antiVirusServerUri: Uri? = null,
|
||||
allowedFingerprints: List<Fingerprint> = emptyList(),
|
||||
shouldPin: Boolean = false,
|
||||
tlsVersions: List<TlsVersion>? = null,
|
||||
tlsCipherSuites: List<CipherSuite>? = null,
|
||||
shouldAcceptTlsExtensions: Boolean = true,
|
||||
allowHttpExtension: Boolean = false,
|
||||
forceUsageTlsVersions: Boolean = false
|
||||
) = HomeServerConnectionConfig(
|
||||
homeServerUri,
|
||||
homeServerUriBase,
|
||||
identityServerUri,
|
||||
antiVirusServerUri,
|
||||
allowedFingerprints,
|
||||
shouldPin,
|
||||
tlsVersions,
|
||||
tlsCipherSuites,
|
||||
shouldAcceptTlsExtensions,
|
||||
allowHttpExtension,
|
||||
forceUsageTlsVersions,
|
||||
)
|
||||
}
|
|
@ -21,12 +21,11 @@ import org.matrix.android.sdk.api.auth.data.HomeServerConnectionConfig
|
|||
import org.matrix.android.sdk.api.auth.data.SessionParams
|
||||
import org.matrix.android.sdk.internal.auth.login.LoginType
|
||||
import org.matrix.android.sdk.test.fixtures.CredentialsFixture.aCredentials
|
||||
import org.matrix.android.sdk.test.fixtures.HomeServerConnectionConfigFixture.aHomeServerConnectionConfig
|
||||
|
||||
object SessionParamsFixture {
|
||||
fun aSessionParams(
|
||||
credentials: Credentials = aCredentials(),
|
||||
homeServerConnectionConfig: HomeServerConnectionConfig = aHomeServerConnectionConfig(),
|
||||
homeServerConnectionConfig: HomeServerConnectionConfig = HomeServerConnectionConfig.Builder().withHomeServerUri("homeserver").build(),
|
||||
isTokenValid: Boolean = false,
|
||||
loginType: LoginType = LoginType.UNKNOWN,
|
||||
) = SessionParams(
|
||||
|
|
Loading…
Reference in a new issue