package Ġbr . com . challenge . consult are medi os Ċ Ċ import Ġbr . com . challenge . consult are medi os . api . mobile test . Endpoints Ċ import Ġbr . com . challenge . consult are medi os . api . mobile test . ApiService Ċ import Ġbr . com . challenge . consult are medi os . db . entity . Cart Item Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Test Ċ Ċ class ĠApi Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Banner Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠApi Service . build Service ( Endpoints :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest . getB anners (). execute () ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( response . is Successful ) ĊĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( response . body ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Spot light Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠApi Service . build Service ( Endpoints :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest . get Spot light (). execute () ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( response . is Successful ) ĊĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( response . body ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Game Details Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠApi Service . build Service ( Endpoints :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest . get Game Details ( 1 ). execute () ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( response . is Successful ) ĊĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( response . body ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsearch Games Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠApi Service . build Service ( Endpoints :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest . search Games (" zel da "). execute () ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( response . is Successful ) ĊĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( response . body ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġpost Checkout Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġitems : ĠMutable List < Cart Item > Ġ= ĠArrayList () ĊĠĠĠĠĠĠĠ Ġitems . add ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCart Item ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġgame Id Ġ= Ġ 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtitle Ġ= Ġ" The ĠLegend ĠOf ĠZ el da ĠBre ath Ġof ĠThe ĠW ild ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbox Art Url Ġ= Ġ" https :// switch - br as il . com / wp - content / uploads / 2 0 2 0 / 0 2 / Z el da - Bre ath - of - the - W ild _ Key art . jpg ", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġquantity Ġ= Ġ 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġunit Price Ġ= Ġ 3 5 0 . 0 , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġunit Price With Discount Ġ= Ġ 2 5 0 . 0 ĊĠĠĠĠĠĠĠ Ġ)) ĊĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠApi Service . build Service ( Endpoints :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġresponse Ġ= Ġrequest . post Checkout ( items ). execute () ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( response . is Successful ) ĊĠĠĠ Ġ} Ċ }