@@ -22,6 +22,7 @@ import kotlin.test.assertTrue
2222class RoutingTest {
2323
2424 data class TestHeaderParams (@HeaderParam(" test param" ) val `Test -Header `: Long )
25+ data class TestHeaderParams2 (@HeaderParam(" test param" ) val `test-header`: Long )
2526 data class TestBodyParams (val xyz : Long )
2627 data class TestResponse (val msg : String )
2728
@@ -43,7 +44,7 @@ class RoutingTest {
4344 handleRequest(HttpMethod .Post , route) {
4445 addHeader(HttpHeaders .ContentType , " application/json" )
4546 addHeader(HttpHeaders .Accept , " application/json" )
46- addHeader(" Test-Header " , " 123" )
47+ addHeader(" test-header " , " 123" )
4748 setBody(" {\" xyz\" :456}" )
4849 }.apply {
4950 assertTrue { response.contentType().match(" application/json" ) }
@@ -64,7 +65,7 @@ class RoutingTest {
6465 apiRouting {
6566 (this .ktorRoute as Routing ).trace { println (it.buildText()) }
6667 route(route) {
67- get<TestHeaderParams , TestResponse > { params ->
68+ get<TestHeaderParams2 , TestResponse > { params ->
6869 respond(TestResponse (" $params " ))
6970 }
7071 }
@@ -76,7 +77,7 @@ class RoutingTest {
7677 }.apply {
7778 assertTrue { response.contentType().match(" application/json" ) }
7879 assertEquals(
79- " {\" msg\" :\" ${TestHeaderParams (123 )} \" }" ,
80+ " {\" msg\" :\" ${TestHeaderParams2 (123 )} \" }" ,
8081 response.content
8182 )
8283 }
@@ -136,4 +137,4 @@ class RoutingTest {
136137 }
137138 }
138139 }
139- }
140+ }
0 commit comments