Small quality fixes

This commit is contained in:
Benoit Marty
2024-06-12 09:13:48 +02:00
parent f2a7a3b8f9
commit 634118ecb8
2 changed files with 4 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ class DefaultElementCallBaseUrlProvider @Inject constructor(
} catch (e: HttpException) {
Timber.w(e, "Failed to fetch wellknown data")
// 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
}
null

View File

@@ -116,9 +116,9 @@ class DefaultCallWidgetProviderTest {
@Test
fun `getWidget - will use a wellknown base url if it exists`() = runTest {
val aCustomUrl = "https://custom.element.io"
val provideLambda = lambdaRecorder<SessionId, String?> { String -> aCustomUrl }
val providesLambda = lambdaRecorder<SessionId, String?> { _ -> aCustomUrl }
val elementCallBaseUrlProvider = FakeElementCallBaseUrlProvider { sessionId ->
provideLambda(sessionId)
providesLambda(sessionId)
}
val room = FakeMatrixRoom().apply {
givenGenerateWidgetWebViewUrlResult(Result.success("url"))
@@ -135,7 +135,7 @@ class DefaultCallWidgetProviderTest {
)
provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme")
assertThat(settingsProvider.providedBaseUrls).containsExactly(aCustomUrl)
provideLambda.assertions()
providesLambda.assertions()
.isCalledOnce()
.with(value(A_SESSION_ID))
}