rimajon-ktor/test/ApplicationTest.kt

27 lines
661 B
Kotlin
Raw Normal View History

2020-09-21 21:25:21 +00:00
package dev.araozu
import io.ktor.application.*
import io.ktor.response.*
import io.ktor.request.*
import io.ktor.features.*
import io.ktor.routing.*
import io.ktor.http.*
import io.ktor.websocket.*
import io.ktor.http.cio.websocket.*
import java.time.*
import io.ktor.gson.*
import kotlin.test.*
import io.ktor.server.testing.*
class ApplicationTest {
@Test
fun testRoot() {
withTestApplication({ module(testing = true) }) {
handleRequest(HttpMethod.Get, "/").apply {
assertEquals(HttpStatusCode.OK, response.status())
assertEquals("HELLO WORLD!", response.content)
}
}
}
}