package Ġserver . route . handler Ċ Ċ import Ġio . ktor . http . HttpHeaders Ċ import Ġorg . junit . Test Ċ import Ġserver . run Handler Ċ import Ġkotlin . test . assertEquals Ċ import Ġkotlin . test . fail Ċ Ċ class ĠHello World Route Handler Tests Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` handler Ġrespon ds Ġwith Ġhello Ġworld `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhandler Ġ= ĠHello World Route Handler () ĊĊĠĠĠĠĠĠĠ Ġval Ġcall Ġ= Ġrun Handler ( handler ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresponse Content Ġ= Ġcall . response . content Ġ?: Ġfail (" expected Ġa Ġresponse Ġbody ") ĊĠĠĠĠĠĠĠ Ġval Ġexpected ContentType Ġ= Ġ" text / plain ; Ġcharset = UTF - 8 " ĊĠĠĠĠĠĠĠ ĠassertEquals ( expected ContentType , Ġcall . response . headers [ HttpHeaders . ContentType ]) ĊĠĠĠĠĠĠĠ ĠassertEquals (" hello , Ġworld !", Ġresponse Content ) ĊĠĠĠ Ġ} Ċ } Ċ