import Ġcom . n ha ar man . mock it ok otlin 2 . mock Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . verify Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . wh enever Ċ import Ġda ik on . core . Request Ċ import Ġda ik on . core . Response Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . mockito . Mockito . contains Ċ Ċ class ĠBox Page Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġrequest : ĠRequest Ġ= Ġmock () ĊĠĠĠ Ġprivate Ġval Ġresponse : ĠResponse Ġ= Ġmock () ĊĠĠĠ Ġprivate Ġval Ġrepository : ĠVe get able Repository Ġ= Ġmock () ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` show Ġlist `() Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( repository . all ()). thenReturn ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠVe get able (" Da ik on ", Ġ" The Ġbest Ġone "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠVe get able (" Car rot ", Ġ" The Ġmost Ġorange ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ ĠBox Page ( repository ). handle ( request , Ġresponse , Ġmock ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( response ). write ( contains (""" id =" Da ik on """" )) ĊĠĠĠĠĠĠĠ Ġverify ( response ). write ( contains (""" id =" Car rot """" )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` show Ġlinks `() Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( repository . all ()). thenReturn ( listOf ( Ve get able (" Da ik on ", Ġ" The Ġbest Ġone "))) ĊĊĠĠĠĠĠĠĠ ĠBox Page ( repository ). handle ( request , Ġresponse , Ġmock ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( response ). write ( contains (""" < a Ġhref ="/ Da ik on " Ġid =" Da ik on "> Da ik on </ a > "" ")) ĊĠĠĠĠĠĠĠ Ġverify ( response ). write ( contains (""" < a Ġhref ="/ Da ik on / edit " Ġid =" Edit Da ik on "> change </ a > "" ")) ĊĠĠĠĠĠĠĠ Ġverify ( response ). write ( contains (""" ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ< form Ġaction ="/ Da ik on / delete " Ġmethod =" post " Ġclass =" action "> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ< button Ġtype =" submit " Ġid =" E at Da ik on "> eat </ button > ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ</ form > """ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` show Ġadd Ġbutton `() Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( repository . all ()). thenReturn ( emptyList ()) ĊĊĠĠĠĠĠĠĠ ĠBox Page ( repository ). handle ( request , Ġresponse , Ġmock ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( response ). write ( contains (""" < a Ġhref ="/ add " Ġid =" add " Ġclass =" btn "> "" ")) ĊĠĠĠ Ġ} Ċ }