package Ġcom . jo h ng ach i hi . park ing . mod b ust cp . controllers Ċ Ċ import Ġcom . jo h ng ach i hi . park ing . Invalid Ticket Code Exception Ċ import Ġcom . jo h ng ach i hi . park ing . mod b ust cp . request Handling . Mod bus ResponseStatus Ċ import Ġcom . jo h ng ach i hi . park ing . services . Entry Service Ċ import Ġio . mock k . every Ċ import Ġio . mock k . impl . annotations . Inject Mock Ks Ċ import Ġio . mock k . impl . annotations . Mock K Ċ import Ġio . mock k . junit 5 . Mock K Extension Ċ import Ġio . mock k . verify Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . DisplayName Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . extension . Extend With Ċ Ċ @ DisplayName (" Test ĠMod bus Entry Controller ") Ċ @ Extend With ( Mock K Extension :: class ) Ċ internal Ġclass ĠMod bus Entry Controller Test Ġ{ ĊĠĠĠ Ġ@ Mock K ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġentry Service : ĠEntry Service ĊĊĠĠĠ Ġ@ Inject Mock Ks ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġmod bus Entry Controller : ĠMod bus Entry Controller ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Uses ĠEntry Service Ġto Ġadd Ġa Ġnew Ġvisit `() Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġentry Service . add Visit ( any ()) Ġ} Ġanswers Ġ{} ĊĊĠĠĠĠĠĠĠ Ġmod bus Entry Controller . handle Request ( 1 9 9 8 ) ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġentry Service . add Visit ( 1 9 9 8 ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ DisplayName ( ĊĠĠĠĠĠĠĠ Ġ" When Ġattempt Ġto Ġadd Ġnew Ġentry Ġthrows Ġan ĠInvalid Ticket Code Exception , Ġ" Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" then Ġreturns Ġan ĠIllegal Data Ġresponse Ġstatus " ĊĠĠĠ Ġ) ĊĠĠĠ Ġfun Ġtest When Invalid Ticket Code Exception Thrown () Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġentry Service . add Visit ( any ()) Ġ} Ġthrows ĠInvalid Ticket Code Exception ("") ĊĊĠĠĠĠĠĠĠ Ġval Ġresponse Status Ġ= Ġmod bus Entry Controller . handle Request ( 1 2 3 4 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( response Status ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isEqualTo ( Mod bus ResponseStatus . IL LEG AL _ DATA ) ĊĠĠĠ Ġ} Ċ }