ApplicationTest.kt 959 B

123456789101112131415161718192021222324252627282930313233343536
  1. package ru.mephi
  2. import io.ktor.routing.*
  3. import io.ktor.http.*
  4. import io.ktor.auth.*
  5. import io.ktor.util.*
  6. import io.ktor.auth.jwt.*
  7. import com.auth0.jwt.JWT
  8. import com.auth0.jwt.JWTVerifier
  9. import com.auth0.jwt.algorithms.Algorithm
  10. import io.ktor.sessions.*
  11. import io.ktor.http.content.*
  12. import io.ktor.features.*
  13. import org.slf4j.event.*
  14. import io.ktor.request.*
  15. import io.micrometer.prometheus.*
  16. import io.ktor.metrics.micrometer.*
  17. import io.ktor.serialization.*
  18. import io.ktor.server.engine.*
  19. import io.ktor.application.*
  20. import io.ktor.response.*
  21. import kotlin.test.*
  22. import io.ktor.server.testing.*
  23. import ru.mephi.plugins.*
  24. class ApplicationTest {
  25. @Test
  26. fun testRoot() {
  27. withTestApplication({ configureRouting() }) {
  28. handleRequest(HttpMethod.Get, "/").apply {
  29. assertEquals(HttpStatusCode.OK, response.status())
  30. assertEquals("Hello World!", response.content)
  31. }
  32. }
  33. }
  34. }