fun test2() { withTestApplication { HttpClient(TestHttpClientEngine.config { app = this@withTestApplication }) { install(JsonFeature) { serializer = KotlinxSerializer() } }.use { client -> runBlocking { val result = client.post { url { host = "localhost" port = 8080 path("deal") method = HttpMethod.Post } contentType(ContentType.Application.Json) body = NewDeal( name = "test deal0", north = "AKQJ AKQJ AKQJ A", east = "AKQJ AKQJ AKQJ A", south = "AKQJ AKQJ AKQJ A", west = "AKQJ AKQJ AKQJ A" ) } assertTrue { result.startsWith("NewDeal(") } } } } }