Skip to content
Snippets Groups Projects
Verified Commit e605da31 authored by Torsten Grote's avatar Torsten Grote
Browse files

Add Jackson to test HTTP client as well

parent 5e797efb
No related branches found
No related tags found
1 merge request!29Create base IntegrationTest; move Contact; add Jackson
......@@ -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"
}
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment