output-service-rdb/test/ApplicationTest.kt

31 lines
771 B
Kotlin
Raw Normal View History

2020-04-04 18:47:24 +02:00
package com.kmalbz
import io.ktor.application.*
import io.ktor.response.*
import io.ktor.request.*
import io.ktor.routing.*
import io.ktor.http.*
import io.ktor.gson.*
import io.ktor.features.*
import io.ktor.client.*
import io.ktor.client.engine.apache.*
import io.ktor.auth.*
import kotlin.reflect.*
import java.util.*
import kotlin.test.*
import io.ktor.server.testing.*
2020-04-05 11:14:02 +02:00
import io.ktor.util.KtorExperimentalAPI
2020-04-04 18:47:24 +02:00
class ApplicationTest {
2020-04-05 11:14:02 +02:00
@KtorExperimentalAPI
2020-04-04 18:47:24 +02:00
@Test
fun testRoot() {
withTestApplication({ module(testing = true) }) {
handleRequest(HttpMethod.Get, "/").apply {
assertEquals(HttpStatusCode.OK, response.status())
assertEquals("HELLO WORLD!", response.content)
}
}
}
}