Created
August 7, 2020 10:52
-
-
Save perbu/2cbd5d5e26a9f082bd5a51dd1608ee95 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 integration | |
import io.ktor.application.Application | |
import io.ktor.http.HttpMethod | |
import io.ktor.http.HttpStatusCode | |
import io.ktor.server.testing.TestApplicationEngine | |
import io.ktor.server.testing.handleRequest | |
import io.ktor.server.testing.withTestApplication | |
import ombruk.backend.module | |
import org.junit.Test | |
import kotlin.test.assertEquals | |
class ApplicationTest { | |
companion object { | |
var app = TestApplicationEngine { | |
} | |
} | |
@Test | |
fun test1() { | |
assertEquals(1, 1) | |
} | |
@Test | |
fun testHealth() = withTestApplication({ | |
module(true) | |
}) { | |
with(handleRequest(HttpMethod.Get, "/health_check") { | |
addHeader("Foo", "Bar") | |
}) { | |
assertEquals(HttpStatusCode.OK, this.response.status()) | |
} | |
}. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment