-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: some end points are not routed through the proxy server v4.5 (#2485
) * fix: some end points are not routed through the proxy server (#2400) * fix: some end points are not routed through the proxy server * fix cli * fix android sample * fix test service * detekt * fix ios target * fix tests * refactor: reimplement update api versions usecase to use proxy (#2414) * refactor: implement UpdateApiVersionsUseCaseImpl to be proxy safe * feat: add proxy URL and need auth indication to custom server dialogs * fix tests (cherry picked from commit b1f1457) * fix cherry pick issues * detekt * trigger CI * fix import * fix test (cherry picked from commit 5651bb1)
- Loading branch information
1 parent
9ec9a54
commit d0d11cc
Showing
13 changed files
with
51 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
package com.wire.kalium.logic.feature.auth | ||
|
||
import com.wire.kalium.logic.NetworkFailure | ||
import com.wire.kalium.logic.configuration.server.CustomServerConfigRepository | ||
import com.wire.kalium.logic.configuration.server.ServerConfig | ||
import com.wire.kalium.logic.data.auth.login.DomainLookupResult | ||
import com.wire.kalium.logic.data.auth.login.SSOLoginRepository | ||
import com.wire.kalium.logic.di.MapperProvider | ||
|
@@ -41,7 +43,6 @@ import kotlin.test.Test | |
import kotlin.test.assertEquals | ||
import kotlin.test.assertIs | ||
|
||
@OptIn(ExperimentalCoroutinesApi::class) | ||
class DomainLookupUseCaseTest { | ||
|
||
@Test | ||
|
@@ -83,8 +84,8 @@ class DomainLookupUseCaseTest { | |
.arrange() | ||
useCases(userEmail) | ||
|
||
verify(arrangement.serverConfigApi) | ||
.suspendFunction(arrangement.serverConfigApi::fetchServerConfig) | ||
verify(arrangement.customServerConfigRepository) | ||
.suspendFunction(arrangement.customServerConfigRepository::fetchRemoteConfig) | ||
.with(eq("https://wire.com")) | ||
.wasInvoked(exactly = once) | ||
} | ||
|
@@ -94,9 +95,6 @@ class DomainLookupUseCaseTest { | |
val userEmail = "[email protected]" | ||
val expectedServerLinks = newServerConfig(1).links | ||
|
||
val expextedDTO = expectedServerLinks.let { | ||
MapperProvider.serverConfigMapper().toDTO(it) | ||
} | ||
val (arrangement, useCases) = Arrangement() | ||
.withDomainLookupResult(Either.Right(DomainLookupResult("https://wire.com", "https://wire.com"))) | ||
.withFetchServerConfigResult(NetworkResponse.Success(expextedDTO, emptyMap(), 200,)) | ||
|
@@ -112,8 +110,8 @@ class DomainLookupUseCaseTest { | |
.with(eq("wire.com")) | ||
.wasInvoked(exactly = once) | ||
|
||
verify(arrangement.serverConfigApi) | ||
.suspendFunction(arrangement.serverConfigApi::fetchServerConfig) | ||
verify(arrangement.customServerConfigRepository) | ||
.suspendFunction(arrangement.customServerConfigRepository::fetchRemoteConfig) | ||
.with(eq("https://wire.com")) | ||
.wasInvoked(exactly = once) | ||
} | ||
|
@@ -124,10 +122,10 @@ class DomainLookupUseCaseTest { | |
val ssoLoginRepository: SSOLoginRepository = mock(SSOLoginRepository::class) | ||
|
||
@Mock | ||
val serverConfigApi: ServerConfigApi = mock(ServerConfigApi::class) | ||
val customServerConfigRepository: CustomServerConfigRepository = mock(CustomServerConfigRepository::class) | ||
|
||
private val useCases = DomainLookupUseCase( | ||
serverConfigApi, | ||
customServerConfigRepository, | ||
ssoLoginRepository | ||
) | ||
|
||
|
@@ -138,9 +136,10 @@ class DomainLookupUseCaseTest { | |
.thenReturn(result) | ||
} | ||
|
||
fun withFetchServerConfigResult(result: NetworkResponse<ServerConfigDTO.Links>) = apply { | ||
given(serverConfigApi) | ||
.suspendFunction(serverConfigApi::fetchServerConfig) | ||
fun withFetchServerConfigResult(result: | ||
Either<NetworkFailure, ServerConfig.Links>) = apply { | ||
given(customServerConfigRepository) | ||
.suspendFunction(customServerConfigRepository::fetchRemoteConfig) | ||
.whenInvokedWith(any()) | ||
.thenReturn(result) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters