package Ġuk . gov . just ice . digital . h mp ps . csr . api . dto Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġuk . gov . just ice . digital . h mp ps . csr . api . domain . ActionType Ċ import Ġuk . gov . just ice . digital . h mp ps . csr . api . domain . Shift Type Ċ import Ġuk . gov . just ice . digital . h mp ps . csr . api . model . Detail Ċ import Ġjava . time . Clock Ċ import Ġjava . time . LocalDate Ċ import Ġjava . time . LocalDateTime Ċ import Ġjava . time . Local Time Ċ import Ġjava . time . Zone Id Ċ Ċ class ĠDetail Dto Test Ġ{ ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` Create ĠOver time ĠD to `() Ġ{ ĊĠĠĠ Ġval Ġdetail Ġ= Ġget Fully Pop ulated Detail () ĊĠĠĠ Ġval Ġstart Ġ= ĠLocalDate . now ( clock ). at Time ( Local Time . MIN ) ĊĠĠĠ Ġval Ġend Ġ= ĠLocalDate . now ( clock ). at Time ( Local Time . MAX ) ĊĠĠĠ Ġval Ġdetail Dto Ġ= ĠDetail Dto . from ( detail , Ġstart , Ġend ) ĊĊĠĠĠ ĠassertThat ( detail Dto . quantum Id ). isEqualTo ( quantum Id ) ĊĠĠĠ ĠassertThat ( detail Dto . shift Modified ). isEqualTo ( shift Modified ) ĊĠĠĠ ĠassertThat ( detail Dto . shift Type ). isEqualTo ( shift Type ) ĊĠĠĠ ĠassertThat ( detail Dto . detail Start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( detail Dto . detail End ). isEqualTo ( end ) ĊĠĠĠ ĠassertThat ( detail Dto . activity ). isEqualTo ( activity ) ĊĠĠĠ ĠassertThat ( detail Dto . action Type ). isEqualTo ( action Type ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` Create ĠOver time ĠD to Ġeven Ġif Ġvalues Ġare Ġnull `() Ġ{ ĊĠĠĠ Ġval Ġdetail Ġ= ĠDetail ( ĊĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠ ĠLocalDate . now (), ĊĠĠĠĠĠ ĠShift Type . SHIFT . value , ĊĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠ Ġnull ĊĠĠĠ Ġ) ĊĠĠĠ Ġval Ġstart Ġ= ĠLocalDate . now ( clock ). at Time ( Local Time . MIN ) ĊĠĠĠ Ġval Ġend Ġ= ĠLocalDate . now ( clock ). at Time ( Local Time . MAX ) ĊĠĠĠ Ġval Ġdetail Dto Ġ= ĠDetail Dto . from ( detail , Ġstart , Ġend ) ĊĊĠĠĠ ĠassertThat ( detail Dto . quantum Id ). isNull () ĊĠĠĠ ĠassertThat ( detail Dto . shift Modified ). isNull () ĊĠĠĠ ĠassertThat ( detail Dto . detail Start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( detail Dto . detail End ). isEqualTo ( end ) ĊĠĠĠ ĠassertThat ( detail Dto . activity ). isNull () ĊĠĠĠ ĠassertThat ( detail Dto . action Type ). isNull () ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġprivate Ġval Ġclock Ġ= ĊĠĠĠĠĠ ĠClock . fixed ( LocalDate . of ( 2 0 2 0 , Ġ 5 , Ġ 3 ). at Start OfDay ( Zone Id . system Default ()). to Instant (), ĠZone Id . system Default ()) ĊĊĠĠĠ Ġprivate Ġval Ġshift Date : ĠLocalDate Ġ= ĠLocalDate . now ( clock ) ĊĠĠĠ Ġprivate Ġconst Ġval Ġdetail StartTime InSeconds Ġ= Ġ 7 2 0 0 L ĊĠĠĠ Ġprivate Ġconst Ġval Ġdetail EndTime InSeconds Ġ= Ġ 8 4 5 0 0 L ĊĠĠĠ Ġconst Ġval Ġquantum Id Ġ= Ġ" XYZ " ĊĠĠĠ Ġval Ġshift Modified : ĠLocalDateTime Ġ= ĠLocalDateTime . now ( clock ). minus Days ( 3 ) ĊĠĠĠ Ġval Ġshift Type Ġ= ĠShift Type . OVER TIME ĊĠĠĠ Ġval Ġaction Type Ġ= ĠAction Type . EDIT ĊĠĠĠ Ġconst Ġval Ġactivity Ġ= Ġ" Phone ĠCenter " ĊĊĠĠĠ Ġfun Ġget Fully Pop ulated Detail (): ĠDetail Ġ{ ĊĊĠĠĠĠĠ Ġreturn ĠDetail ( ĊĠĠĠĠĠĠĠ Ġquantum Id , ĊĠĠĠĠĠĠĠ Ġshift Modified , ĊĠĠĠĠĠĠĠ Ġshift Date , ĊĠĠĠĠĠĠĠ Ġshift Type . value , ĊĠĠĠĠĠĠĠ Ġdetail StartTime InSeconds , ĊĠĠĠĠĠĠĠ Ġdetail EndTime InSeconds , ĊĠĠĠĠĠĠĠ Ġactivity , ĊĠĠĠĠĠĠĠ Ġaction Type . value , ĊĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ