dave
03/04/2019, 1:46 PM@Test
fun `should allow nesting routes`() {
val definitely = listOf(routes("/hello" bind Method.GET to { Response(OK).body("HELLO") }))
val maybe = if (true) listOf(routes("/service/hello" bind Method.GET to { Response(OK).body("BOB") })) else emptyList()
val routes = routes(*(definitely + maybe).toTypedArray())
val helloResponse = routes(Request(Method.GET, "/service/hello"))
assertEquals(helloResponse.status, OK)
}