From e605da318d7a000e1c76d1c36fd029a3bd9a05b1 Mon Sep 17 00:00:00 2001 From: Torsten Grote <t@grobox.de> Date: Tue, 19 Oct 2021 13:06:23 -0300 Subject: [PATCH] Add Jackson to test HTTP client as well --- mailbox-core/build.gradle | 1 + .../org/briarproject/mailbox/core/server/IntegrationTest.kt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mailbox-core/build.gradle b/mailbox-core/build.gradle index 6862050c..198bff74 100644 --- a/mailbox-core/build.gradle +++ b/mailbox-core/build.gradle @@ -35,6 +35,7 @@ dependencies { testImplementation "io.mockk:mockk:$mockk_version" testImplementation "ch.qos.logback:logback-classic:1.2.5" testImplementation "io.ktor:ktor-client-cio:$ktor_version" + testImplementation "io.ktor:ktor-client-jackson:$ktor_version" testImplementation "com.google.dagger:hilt-core:$hilt_version" kaptTest "com.google.dagger:dagger-compiler:$hilt_version" } diff --git a/mailbox-core/src/test/java/org/briarproject/mailbox/core/server/IntegrationTest.kt b/mailbox-core/src/test/java/org/briarproject/mailbox/core/server/IntegrationTest.kt index 695d0b5a..0938a91c 100644 --- a/mailbox-core/src/test/java/org/briarproject/mailbox/core/server/IntegrationTest.kt +++ b/mailbox-core/src/test/java/org/briarproject/mailbox/core/server/IntegrationTest.kt @@ -2,6 +2,8 @@ package org.briarproject.mailbox.core.server import io.ktor.client.HttpClient import io.ktor.client.engine.cio.CIO +import io.ktor.client.features.json.JacksonSerializer +import io.ktor.client.features.json.JsonFeature import org.briarproject.mailbox.core.DaggerTestComponent import org.briarproject.mailbox.core.TestComponent import org.briarproject.mailbox.core.TestModule @@ -20,6 +22,9 @@ abstract class IntegrationTest { private val lifecycleManager by lazy { testComponent.getLifecycleManager() } protected val httpClient = HttpClient(CIO) { expectSuccess = false // prevents exceptions on non-success responses + install(JsonFeature) { + serializer = JacksonSerializer() + } } protected val baseUrl = "http://127.0.0.1:$PORT" -- GitLab