Testing the service
To write our first test, let's create a new file called ServerTest.kt
under the src/test/kotlin
directory.
Now, let's add a new dependency:
dependencies { Â Â Â Â ... Â Â Â Â testImplementation("io.ktor:ktor-server- Â Â Â Â Â Â Â Â tests:$ktorVersion") }
Next, let's add the following contents to our ServerTest.kt
file:
internal class ServerTest {     @Test     fun testStatus() {         withTestApplication {             val response = handleRequest(HttpMethod.Get,                 "/status").response             assertEquals(HttpStatusCode.OK,       ...