package Ġorg . kode in . di . ktor . controller Ċ Ċ import Ġio . ktor . application .* Ċ import Ġio . ktor . http .* Ċ import Ġio . ktor . server . testing .* Ċ import Ġorg . junit .* Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runners .* Ċ import Ġkotlin . test .* Ċ Ċ @ Fix Method Order ( Method Sort ers . NAME _ ASC ENDING ) Ċ class ĠK tor Controller Tests Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest _ 0 0 _ success Abstract K ode in Controller Feature (): ĠUnit Ġ= Ġwith Test Application ( Application :: kode in Abs Controller Success ) Ġ{ ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , ĠROUT E _ VERSION ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( VERSION , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , ĠROUT E _ AUTHOR ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( AUTHOR , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest _ 0 1 _ failure Abstract K ode in Controller Feature () Ġ{ ĊĠĠĠĠĠĠĠ Ġassert Fails With ( Missing Application Feature Exception :: class ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwith Test Application ( Application :: kode in Abs Controller Failure ) Ġ{} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest _ 0 2 _ success K ode in Controller Impl Feature (): ĠUnit Ġ= Ġwith Test Application ( Application :: kode in Controller Impl Success ) Ġ{ ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , ĠROUT E _ VERSION ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( VERSION , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , ĠROUT E _ AUTHOR ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( AUTHOR , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest _ 0 3 _ failure K ode in Controller Impl Feature () Ġ{ ĊĠĠĠĠĠĠĠ Ġassert Fails With ( Missing Application Feature Exception :: class ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwith Test Application ( Application :: kode in controller Impl Failure ) Ġ{} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest _ 0 0 _ success K ode in Controller Auto Configuration (): ĠUnit Ġ= Ġwith Test Application ( Application :: kode in Controller Success ) Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval ĠROUT E _ PROTECT ED Ġ= Ġ"/ protected " ĊĠĠĠĠĠĠĠ Ġval ĠROUT E _ FIRST Ġ= Ġ"/ first " ĊĠĠĠĠĠĠĠ Ġval ĠROUT E _ SECOND Ġ= Ġ"$ ROUTE _ FIRST / second " ĊĠĠĠĠĠĠĠ Ġval ĠROUT E _ TH IRD Ġ= Ġ"$ ROUTE _ SECOND / third " ĊĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , ĠROUT E _ VERSION ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( VERSION , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , ĠROUT E _ AUTHOR ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( AUTHOR , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ FIRST $ ROUTE _ VERSION "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( VERSION , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ FIRST $ ROUTE _ AUTHOR "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( AUTHOR , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ SECOND $ ROUTE _ VERSION "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( VERSION , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ SECOND $ ROUTE _ AUTHOR "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( AUTHOR , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ TH IRD $ ROUTE _ VERSION "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( VERSION , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ TH IRD $ ROUTE _ AUTHOR "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( AUTHOR , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ PROTECT ED $ ROUTE _ VERSION "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( VERSION , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġhandle Request ( HttpMethod . Get , Ġ"$ ROUTE _ PROTECT ED $ ROUTE _ AUTHOR "). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( AUTHOR , Ġresponse . content ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }