Repository: ktorio/ktor
File: ktor-server/ktor-server-tests/common/test/io/ktor/tests/server/routing/RoutingProcessingTest.kt (Kotlin)

Code before:
                }
            }
        }
        on("making request to /paramFirst with `param` query parameter and accept header") {
            client.get("/paramFirst?param=value") {
                header(HttpHeaders.Accept, "text/plain")
            }
            it("should choose param routing") {
                assertEquals(selectedRoute, SelectedRoute.Param)
            }
        }
        on("making request to /headerFirst with `param` query parameter and accept header") {
            client.get("/headerFirst?param=value") {
                header(HttpHeaders.Accept, "text/plain")
            }
            it("should choose header routing") {
                assertEquals(selectedRoute, SelectedRoute.Header)
            }
        }
    }

    @Test
    fun testRoutingAcceptContentSubtypeWildcard() = testApplication {

        routing {
            route("getImage") {
                accept(ContentType.Image.Any) {
                    get { call.respondText { "Image" } }
                }
            }
        }

        on("making request to /getImage with Accept image/png") {
            client.get("/getImage") {
                header(HttpHeaders.Accept, "image/png")
            }
            .let {
                assertEquals(HttpStatusCode.OK, it.status)
                assertEquals("Image", it.bodyAsText())
            }
        }
    }

    @Test
    fun testMostSpecificSelected() = testApplication {
        var path = ""
        routing {
            get("{path...}") {
                path = call.parameters.getAll("path")?.joinToString("/") ?: "/"
            }
            get("z/{path...}") {

Review comment (suggestion):
Prefix `get` feels redundant
```suggestion
            route("image") {
```

Code after:
                }
            }
        }
        on("making request to /paramFirst with `param` query parameter and accept header") {
            client.get("/paramFirst?param=value") {
                header(HttpHeaders.Accept, "text/plain")
            }
            it("should choose param routing") {
                assertEquals(selectedRoute, SelectedRoute.Param)
            }
        }
        on("making request to /headerFirst with `param` query parameter and accept header") {
            client.get("/headerFirst?param=value") {
                header(HttpHeaders.Accept, "text/plain")
            }
            it("should choose header routing") {
                assertEquals(selectedRoute, SelectedRoute.Header)
            }
        }
    }

    @Test
    fun testRoutingAcceptContentSubtypeWildcard() = testApplication {
        routing {
            route("image") {
                accept(ContentType.Image.Any) {
                    get { call.respondText { "Image" } }
                }
            }
            route("any") {
                accept(ContentType.Any) {
                    get { call.respondText { "Any" } }
                }
            }
        }

        on("making request to /image with Accept image/png") {
            client.get("/image") {
                header(HttpHeaders.Accept, ContentType.Image.PNG)
            }.let {
                assertEquals(HttpStatusCode.OK, it.status)
                assertEquals("Image", it.bodyAsText())
            }
        }

        on("making request to /image with Accept */*") {
            client.get("/image") {
                header(HttpHeaders.Accept, ContentType.Any)
            }.let {
                assertEquals(HttpStatusCode.OK, it.status)
                assertEquals("Image", it.bodyAsText())