Created
December 9, 2017 15:58
-
-
Save gedorinku/2ec2f0eb433def777c5342a0e260445f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.gedorinku.ktorapp | |
import io.ktor.application.Application | |
import io.ktor.http.HttpMethod | |
import io.ktor.http.HttpStatusCode | |
import io.ktor.server.testing.handleRequest | |
import io.ktor.server.testing.withTestApplication | |
import org.junit.Test | |
import kotlin.test.assertEquals | |
/** | |
* Created by gedorinku on 2017/12/09. | |
*/ | |
class ApplicationTest { | |
@Test fun testHello() = withTestApplication(Application::sampleApplication) { | |
handleRequest(HttpMethod.Get, "/").run { | |
assertEquals(HttpStatusCode.OK, response.status()) | |
assertEquals("Hello", response.content) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment