Small quality fixes
This commit is contained in:
parent
f2a7a3b8f9
commit
634118ecb8
2 changed files with 4 additions and 4 deletions
|
|
@ -46,7 +46,7 @@ class DefaultElementCallBaseUrlProvider @Inject constructor(
|
||||||
} catch (e: HttpException) {
|
} catch (e: HttpException) {
|
||||||
Timber.w(e, "Failed to fetch wellknown data")
|
Timber.w(e, "Failed to fetch wellknown data")
|
||||||
// Ignore Http 404, but re-throws any other exceptions
|
// Ignore Http 404, but re-throws any other exceptions
|
||||||
if (e.code() != HttpURLConnection.HTTP_NOT_FOUND /* 404 */) {
|
if (e.code() != HttpURLConnection.HTTP_NOT_FOUND) {
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
null
|
null
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,9 @@ class DefaultCallWidgetProviderTest {
|
||||||
@Test
|
@Test
|
||||||
fun `getWidget - will use a wellknown base url if it exists`() = runTest {
|
fun `getWidget - will use a wellknown base url if it exists`() = runTest {
|
||||||
val aCustomUrl = "https://custom.element.io"
|
val aCustomUrl = "https://custom.element.io"
|
||||||
val provideLambda = lambdaRecorder<SessionId, String?> { String -> aCustomUrl }
|
val providesLambda = lambdaRecorder<SessionId, String?> { _ -> aCustomUrl }
|
||||||
val elementCallBaseUrlProvider = FakeElementCallBaseUrlProvider { sessionId ->
|
val elementCallBaseUrlProvider = FakeElementCallBaseUrlProvider { sessionId ->
|
||||||
provideLambda(sessionId)
|
providesLambda(sessionId)
|
||||||
}
|
}
|
||||||
val room = FakeMatrixRoom().apply {
|
val room = FakeMatrixRoom().apply {
|
||||||
givenGenerateWidgetWebViewUrlResult(Result.success("url"))
|
givenGenerateWidgetWebViewUrlResult(Result.success("url"))
|
||||||
|
|
@ -135,7 +135,7 @@ class DefaultCallWidgetProviderTest {
|
||||||
)
|
)
|
||||||
provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme")
|
provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme")
|
||||||
assertThat(settingsProvider.providedBaseUrls).containsExactly(aCustomUrl)
|
assertThat(settingsProvider.providedBaseUrls).containsExactly(aCustomUrl)
|
||||||
provideLambda.assertions()
|
providesLambda.assertions()
|
||||||
.isCalledOnce()
|
.isCalledOnce()
|
||||||
.with(value(A_SESSION_ID))
|
.with(value(A_SESSION_ID))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue