package Ġnet . in her ency . fin ances . domain . bill Ċ Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . wh enever Ċ import Ġnet . in her ency . fin ances . external . google . Google Sheet Client Ċ import Ġnet . in her ency . fin ances . external . google . Tab Name Ċ import Ġorg . junit . jupiter . api . Assertions Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito Annotations Ċ Ċ class ĠBill Repository Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbill Repository : ĠBill Repository ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġgoogle Sheet Client : ĠGoogle Sheet Client ĊĊĠĠĠ Ġ@ BeforeEach ĊĠĠĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠĠĠĠĠĠĠ Ġbill Repository Ġ= ĠBill Repository ( google Sheet Client ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Repository Ġshould Ġsuccessfully Ġmap Ġrows , Ġignoring Ġthe Ġfirst Ġrow Ġbecause Ġit Ġis Ġa Ġheader `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinput Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠlistOf (" Account ĠId ", Ġ" Name ", Ġ" Description ", Ġ" Due ĠDay ĠOf ĠMonth ", Ġ" Auto Pay ĠEnabled ?", Ġ" Show ĠIn ĠUI ĠReports ? "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠlistOf (" 7 ", Ġ" Water ", Ġ" Water ĠBill ", Ġ" 1 6 ", Ġ" FALSE ", Ġ" TRUE "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠlistOf (" 1 3 ", Ġ" HO A ", Ġ" HO A ĠBill ", Ġ" 1 ", Ġ" TRUE ", Ġ" FALSE ") ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġwhenever ( google Sheet Client . list Values In Tab ( Tab Name . B IL LS )). thenReturn ( input ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġbill Repository . read All () ĊĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( 2 , Ġresult . size ) ĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( Bill Data ( 7 , Ġ" Water ", Ġ" Water ĠBill ", Ġ 1 6 , Ġauto Pay Enabled Ġ= Ġfalse , Ġshow In UI Reports Ġ= Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresult [ 0 ]) ĊĠĠĠĠĠĠĠ ĠAssertions . assertEquals ( Bill Data ( 1 3 , Ġ" HO A ", Ġ" HO A ĠBill ", Ġ 1 , Ġauto Pay Enabled Ġ= Ġtrue , Ġshow In UI Reports Ġ= Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresult [ 1 ]) ĊĠĠĠ Ġ} Ċ Ċ }