package Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . reports Ċ Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Nested Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . http . MediaType Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . No Queue Listener IntegrationTest Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . entity . Message Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . BOOK ING _ NUMBER _ NOT _ ASS IGNED Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . COMPLETED Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . ERROR Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . KEY _ DAT ES _ NOT _ UPDATED Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . LOCATION _ NOT _ UPDATED Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . NO _ LON GER _ VALID Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . NO _ MATCH Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . NO _ MATCH _ WITH _ SENT ENCE _ DATE Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . TOO _ MAN Y _ MATCH ES Ċ import Ġuk . gov . just ice . digital . h mp ps . pr is onto prob ation . services . Synchron ise State . VALID ATED Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . time . Zone Offset Ċ import Ġjava . time . format . DateTime Formatter Ċ import Ġkotlin . random . Random Ċ Ċ class ĠMatch ing Summary Report AP ITest Ġ: ĠNo Queue Listener IntegrationTest () Ġ{ ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` requires Ġa Ġvalid Ġauthentication Ġtoken `() Ġ{ ĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri ("/ report / match - summary ") ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Unauthorized ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` without ĠROLE _ P TP U _ REPORT Ġaccess Ġis Ġdenied `() Ġ{ ĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri ("/ report / match - summary ") ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ BAN AN AS "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Forbidden ĊĠ Ġ} ĊĊĠ Ġ@ Nested ĊĠ Ġinner Ġclass ĠTotal s Break down Ġ{ ĊĠĠĠ Ġ@ BeforeEach ĊĠĠĠ Ġinternal Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠ Ġmessage Repository . save All ( ĊĠĠĠĠĠĠĠ ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday (), ĠeventType Ġ= Ġ" SENT ENCE _ DAT ES - CHANGED "), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠNO _ LON GER _ VALID , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠVALID ATED , Ġretry Count Ġ= Ġ 0 ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠNO _ MATCH ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠNO _ MATCH _ WITH _ SENT ENCE _ DATE ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠTO O _ MAN Y _ MATCH ES ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠBO OK ING _ NUMBER _ NOT _ ASS IGNED ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠLOC ATION _ NOT _ UPDATED ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠKEY _ DAT ES _ NOT _ UPDATED ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠERROR ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠNO _ MATCH ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠNO _ MATCH _ WITH _ SENT ENCE _ DATE ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠTO O _ MAN Y _ MATCH ES ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠBO OK ING _ NUMBER _ NOT _ ASS IGNED ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠLOC ATION _ NOT _ UPDATED ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠKEY _ DAT ES _ NOT _ UPDATED ), ĊĠĠĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 8 , Ġstatus Ġ= ĠERROR ), ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` can Ġretrieve Ġa Ġsummary Ġreport Ġbreaking Ġdown Ġtotals Ġfor ĠIMP R IS ON MENT _ STATUS - CHANGED `() Ġ{ ĊĠĠĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠĠĠ Ġ. uri ("/ report / match - summary ") ĊĠĠĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 1 8 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" completed . total "). isEqualTo ( 3 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" completed . success "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" completed . rejected "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . total "). isEqualTo ( 8 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . new "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . retry "). isEqualTo ( 7 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . no - match "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . no - match - sentence "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . too - many - matches "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . book - number - set - fail "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . location - set - fail "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . key - dates - set - fail "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . error - fail "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . total "). isEqualTo ( 7 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . no - match "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . no - match - sentence "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . too - many - matches "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . book - number - set - fail "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . location - set - fail "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . key - dates - set - fail "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . error - fail "). isEqualTo ( 1 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` adjust ing Ġs la Ġadjust s Ġtotals Ġin Ġbuckets `() Ġ{ ĊĠĠĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠĠĠ Ġ. uri Ġ{ Ġit . path ("/ report / match - summary "). query Param (" sla Days ", Ġ" 9 "). build () Ġ} ĊĠĠĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 1 8 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" completed . total "). isEqualTo ( 3 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" completed . success "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" completed . rejected "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . total "). isEqualTo ( 1 5 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . new "). isEqualTo ( 1 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . retry "). isEqualTo ( 1 4 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . no - match "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . no - match - sentence "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . too - many - matches "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . book - number - set - fail "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . location - set - fail "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . key - dates - set - fail "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" waiting . category . error - fail "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . total "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . no - match "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . no - match - sentence "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . too - many - matches "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . book - number - set - fail "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . location - set - fail "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . key - dates - set - fail "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġ. json Path (" ex ceeded - sla . category . error - fail "). isEqualTo ( 0 ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` can Ġfilter Ġby Ġpr ison `() Ġ{ ĊĠĠĠ Ġmessage Repository . save All ( ĊĠĠĠĠĠ ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday (), Ġlocation Id Ġ= Ġ" M DI "), ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday (), Ġlocation Id Ġ= Ġ" M DI "), ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday (), Ġlocation Id Ġ= Ġ" W WI "), ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri ("/ report / match - summary ") ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 3 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ Ġit . path ("/ report / match - summary "). query Param (" location Id ", Ġ" M DI "). build () Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 2 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ Ġit . path ("/ report / match - summary "). query Param (" location Id ", Ġ" W WI "). build () Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 1 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` can Ġfilter Ġby Ġear liest Ġcreated Ġdate `() Ġ{ ĊĠĠĠ Ġmessage Repository . save All ( ĊĠĠĠĠĠ ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 5 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 0 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri ("/ report / match - summary ") ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 3 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ ĊĠĠĠĠĠĠĠ Ġit . path ("/ report / match - summary "). query Param (" created Date Start DateTime ", Ġdays Ago ( 1 1 )) ĊĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 3 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ ĊĠĠĠĠĠĠĠ Ġit . path ("/ report / match - summary "). query Param (" created Date Start DateTime ", Ġdays Ago ( 6 )) ĊĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 2 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ ĊĠĠĠĠĠĠĠ Ġit . path ("/ report / match - summary "). query Param (" created Date Start DateTime ", Ġdays Ago ( 2 )) ĊĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 1 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` can Ġfilter Ġby Ġlatest Ġcreated Ġdate `() Ġ{ ĊĠĠĠ Ġmessage Repository . save All ( ĊĠĠĠĠĠ ĠlistOf ( ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 5 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠĠĠ Ġa Message ( age In Days Ġ= Ġ 1 0 , Ġstatus Ġ= ĠCOMP LETED , Ġprocessed Date Ġ= Ġyesterday ()), ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri ("/ report / match - summary ") ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 3 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ ĊĠĠĠĠĠĠĠ Ġit . path ("/ report / match - summary "). query Param (" created Date End DateTime ", Ġdays Ago ( 1 1 )) ĊĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 0 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ ĊĠĠĠĠĠĠĠ Ġit . path ("/ report / match - summary "). query Param (" created Date End DateTime ", Ġdays Ago ( 9 )) ĊĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 1 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ ĊĠĠĠĠĠĠĠ Ġit . path ("/ report / match - summary "). query Param (" created Date End DateTime ", Ġdays Ago ( 4 )) ĊĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 2 ) ĊĊĠĠĠ Ġweb Test Client . get () ĊĠĠĠĠĠ Ġ. uri Ġ{ ĊĠĠĠĠĠĠĠ Ġit . path ("/ report / match - summary "). query Param (" created Date End DateTime ", Ġdays Ago ( 0 )) ĊĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ. headers ( set Author isation ( roles Ġ= ĠlistOf (" ROLE _ P TP U _ REPORT "))) ĊĠĠĠĠĠ Ġ. accept ( MediaType . APPLICATION _ JSON ) ĊĠĠĠĠĠ Ġ. exchange () ĊĠĠĠĠĠ Ġ. expect Status (). is Ok ĊĠĠĠĠĠ Ġ. expect Body () ĊĠĠĠĠĠ Ġ. json Path (" total "). isEqualTo ( 3 ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġdays Ago ( days : ĠLong ) Ġ= ĠLocalDateTime . now (). minus Days ( days ). format ( DateTime Formatter . ISO _ LOCAL _ DATE _ TIME ) ĊĊĠ Ġfun Ġa Message ( ĊĠĠĠ Ġage In Days : ĠLong , ĊĠĠĠ Ġstatus : ĠSynchron ise State , ĊĠĠĠ Ġprocessed Date : ĠLocalDateTime ? Ġ= Ġnull , ĊĠĠĠ Ġlocation Id : ĠString Ġ= Ġ" M DI ", ĊĠĠĠ Ġretry Count : ĠInt Ġ= Ġ 9 9 , ĊĠĠĠ ĠeventType : ĠString Ġ= Ġ" IMP R IS ON MENT _ STATUS - CHANGED " ĊĠ Ġ): ĠMessage Ġ= ĠMessage ( ĊĠĠĠ Ġbooking Id Ġ= ĠRandom . next Long (), ĊĠĠĠ ĠeventType Ġ= ĠeventType , ĊĠĠĠ Ġretry Count Ġ= Ġretry Count , ĊĠĠĠ Ġcreated Date Ġ= ĠLocalDateTime . now (). minus Days ( age In Days ), ĊĠĠĠ Ġmessage Ġ= Ġ""" {" text ": Ġ" value "} """, ĊĠĠĠ Ġdelete By Ġ= ĠLocalDateTime . now (). plus Days ( 3 0 ). to Epoch Second ( Zone Offset . UTC ), ĊĠĠĠ Ġreport able Ġ= Ġtrue , ĊĠĠĠ Ġoff ender No Ġ= Ġ" A 1 2 3 4 GA ", ĊĠĠĠ Ġbooking No Ġ= Ġ" 1 2 3 4 5 A ", ĊĠĠĠ Ġmatching Cr ns Ġ= Ġ"", ĊĠĠĠ Ġstatus Ġ= Ġstatus . name , ĊĠĠĠ Ġlocation Id Ġ= Ġlocation Id , ĊĠĠĠ Ġlocation Description Ġ= Ġ" Mo or land ĠH MP ", ĊĠĠĠ Ġrecall Ġ= Ġfalse , ĊĠĠĠ Ġlegal Status Ġ= Ġ" SENT ENC ED ", ĊĠĠĠ Ġprocessed Date Ġ= Ġprocessed Date , ĊĠ Ġ) Ċ } Ċ Ċ private Ġfun Ġyesterday () Ġ= ĠLocalDateTime . now (). minus Days ( 1 ) Ċ