Merge pull request #6925 from thundernest/fix_failing_tests

Fix failing tests
This commit is contained in:
Wolf-Martell Montwé 2023-05-25 12:10:56 +00:00 committed by GitHub
commit b99166bc2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -11,6 +11,7 @@ dependencies {
implementation(libs.minidns.hla)
compileOnly(libs.xmlpull)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.kxml2)
testImplementation(libs.jsoup)
testImplementation(libs.okhttp.mockwebserver)

View file

@ -4,6 +4,7 @@ import assertk.assertThat
import assertk.assertions.isEqualTo
import assertk.assertions.isNull
import kotlin.test.assertNotNull
import kotlinx.coroutines.test.runTest
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.OkHttpClient
import okhttp3.mockwebserver.MockResponse
@ -14,7 +15,7 @@ class AutoconfigFetcherTest {
private val fetcher = AutoconfigFetcher(OkHttpClient.Builder().build())
@Test
fun shouldHandleNonexistentUrl() {
fun shouldHandleNonexistentUrl() = runTest {
val nonExistentUrl =
"https://autoconfig.domain.invalid/mail/config-v1.1.xml?emailaddress=test%40domain.example".toHttpUrl()
@ -24,7 +25,7 @@ class AutoconfigFetcherTest {
}
@Test
fun shouldHandleEmptyResponse() {
fun shouldHandleEmptyResponse() = runTest {
val server = MockWebServer().apply {
this.enqueue(
MockResponse()