package Ġru . ot us . ot us kotlin . marketplace . controllers Ċ Ċ import Ġru . ot us . ot us kotlin . marketplace . stubs . B olt Ċ import Ġorg . junit . Test Ċ import Ġru . ot us . ot us kotlin . marketplace . Utils Ċ import Ġru . ot us . ot us kotlin . marketplace . Utils . assert List Equals Ċ import Ġru . ot us . ot us kotlin . marketplace . Utils . stub Cre atable Ad Ċ import Ġru . ot us . ot us kotlin . marketplace . Utils . stub Success Debug Ċ import Ġru . ot us . ot us kotlin . marketplace . Utils . stub Update able Ad Ċ import Ġru . ot us . ot us kotlin . marketplace . openapi . models .* Ċ import Ġkotlin . test . assertEquals Ċ import Ġkotlin . test . assertNotNull Ċ import Ġkotlin . test . assertNull Ċ Ċ class ĠAd Router Stub Test Ġ: ĠRouter Test () Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Post Ad Create () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠCreate Ad Request ( create Ad Ġ= Ġstub Cre atable Ad , Ġdebug Ġ= ĠUtils . stub Success Debug ) ĊĊĠĠĠĠĠĠĠ Ġtest Post Request < Create Ad Response >( data , Ġ"/ ad / create ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Create Ad Response . Result . SUCCESS , Ġresult ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertNull ( errors ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Utils . stub Response Ad , Ġcreated Ad ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Post Ad Read () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠRead Ad Request ( read Ad Id Ġ= Ġ" 9 9 9 9 9 ", Ġdebug Ġ= ĠUtils . stub Success Debug ) ĊĊĠĠĠĠĠĠĠ Ġtest Post Request < Read Ad Response >( data , Ġ"/ ad / read ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Read Ad Response . Result . SUCCESS , Ġresult ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertNull ( errors ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Utils . stub Response Ad . copy ( id Ġ= Ġ" 9 9 9 9 9 "), Ġread Ad ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Post Ad Update () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠUpdate Ad Request ( create Ad Ġ= Ġstub Update able Ad , Ġdebug Ġ= ĠUtils . stub Success Debug ) ĊĊĠĠĠĠĠĠĠ Ġtest Post Request < Update Ad Response >( data , Ġ"/ ad / update ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Update Ad Response . Result . SUCCESS , Ġresult ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertNull ( errors ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Utils . stub Response Ad , Ġupdated Ad ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Post Ad Delete () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠDelete Ad Request ( delete Ad Id Ġ= Ġ" 9 8 7 6 5 ", Ġdebug Ġ= ĠUtils . stub Success Debug ) ĊĊĠĠĠĠĠĠĠ Ġtest Post Request < Delete Ad Response >( data , Ġ"/ ad / delete ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Delete Ad Response . Result . SUCCESS , Ġresult ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertNull ( errors ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Post Ad Search () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= ĠSearch Ad Request ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠrequestId Ġ= Ġ" 9 9 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpage Ġ= ĠBase Pag inated Request ( size Ġ= Ġ 3 , Ġlast Id Ġ= Ġ" 6 6 6 "), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdebug Ġ= Ġstub Success Debug ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġtest Post Request < Search Ad Response >( data , Ġ"/ ad / search ") Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertEquals ( Search Ad Response . Result . SUCCESS , Ġresult ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertNull ( errors ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertNotNull ( found Ads ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġassert List Equals ( found Ads !!. map Ġ{ Ġit . id Ġ}, ĠB olt . get Models (). map Ġ{ Ġit . id . id Ġ}, Ġfalse ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ