package Ġcom . co ach . fl ame . appointment . income Ċ Ċ import Ġcom . co ach . fl ame . date . Date Helper . to Z onedDateTime Ċ import Ġcom . co ach . fl ame . domain . Date Interval Dto Ċ import Ġcom . co ach . fl ame . domain . maker . Appointment Dto Builder Ċ import Ġcom . co ach . fl ame . domain . maker . Appointment Dto Maker Ċ import Ġcom . co ach . fl ame . domain . maker . Income Dto Builder Ċ import Ġcom . co ach . fl ame . jpa . entity . Appointment . Companion . to Appointment Ċ import Ġcom . co ach . fl ame . jpa . repository . Appointment Repository Ċ import Ġcom . nat pr y ce . make ite asy . Make It Easy . with Ċ import Ġio . mock k . clear All Mocks Ċ 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 Ġorg . assertj . core . api . BDD Assertions . then Ċ import Ġorg . junit . jupiter . api . After Each Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . extension . Extend With Ċ import Ġjava . time . LocalDate Ċ import Ġjava . util .* Ċ Ċ @ Extend With ( Mock K Extension :: class ) Ċ class ĠIn come ServiceImpl Test Ġ{ ĊĊĠĠĠ Ġ@ Mock K ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġappointment Repository : ĠAppointment Repository ĊĊĠĠĠ Ġ@ Inject Mock Ks ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġclass To Test : ĠIn come ServiceImpl ĊĊĠĠĠ Ġ@ After Each ĊĠĠĠ Ġfun Ġclean Up () Ġ{ ĊĠĠĠĠĠĠĠ Ġclear All Mocks () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` test Ġget Ġall Ġaccepted Ġincome s `() Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġfrom Ġ= ĠLocalDate . of ( 2 0 2 0 , Ġ 1 , Ġ 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġto Ġ= ĠLocalDate . of ( 2 0 2 0 , Ġ 1 2 , Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġuuid Ġ= ĠUUID . randomUUID () ĊĠĠĠĠĠĠĠ Ġval Ġinterval Ġ= ĠDate Interval Dto ( from , Ġto ) ĊĊĠĠĠĠĠĠĠ Ġval ĠlistOf App ointments Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAppointment Dto Builder . maker With Client And Co ach () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. but ( with ( Appointment Dto Maker . d tt m Starts , Ġto Z onedDateTime (" 2 0 2 0 - 0 1 - 0 1 T 1 0 : 1 5 : 3 0 + 0 1 : 0 0 ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith ( Appointment Dto Maker . income , ĠIn come Dto Builder . accepted ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. make () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Appointment (), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAppointment Dto Builder . maker With Client And Co ach () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. but ( with ( Appointment Dto Maker . d tt m Starts , Ġto Z onedDateTime (" 2 0 2 1 - 0 1 - 0 3 T 1 0 : 1 5 : 3 0 + 0 1 : 0 0 ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith ( Appointment Dto Maker . income , ĠIn come Dto Builder . accepted ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. make () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Appointment (), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAppointment Dto Builder . maker With Client And Co ach () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. but ( with ( Appointment Dto Maker . d tt m Starts , Ġto Z onedDateTime (" 2 0 2 0 - 0 1 - 0 2 T 1 0 : 1 5 : 3 0 + 0 1 : 0 0 ")), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwith ( Appointment Dto Maker . income , ĠIn come Dto Builder . rejected ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. make () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. to Appointment ()) ĊĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġappointment Repository . getApp ointments By Co ach Between Dates ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuuid , Ġfrom . at Start OfDay (), Ġto . at Start OfDay () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} Ġreturns ĠlistOf App ointments ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġclass To Test . get Accepted Income s ( uuid , ĠIn come Aggregator . Type . YEAR , Ġinterval ) ĊĊĠĠĠĠĠĠĠ Ġthen ( result ). has Size ( 1 ) ĊĊĠĠĠ Ġ} Ċ Ċ } Ċ