mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Small quality fixes
This commit is contained in:
+1
-1
@@ -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
|
||||||
|
|||||||
+3
-3
@@ -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))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user