Computer scienceBackendKtorAdvanced Ktor

Ktor Testing

Mocking

Report a typo

Write the code that configures the application with the mock server "http://localhost:8080":

fun testHello() = testApplication {
    externalServices {
        /* your code here */ {
            routing {
                get("/mockdata") {
                    call.respond(MockData("Mocked data"))
                }
            }
        }
    }
}
Enter a short text

Create a free account to access the full topic