@@ -960,6 +960,12 @@ class OccupancyControllerIntegrationTest : FullApplicationTest(resetDbBeforeEach
960
960
RealtimeOccupancy (
961
961
childAttendances =
962
962
listOf (
963
+ ChildOccupancyAttendance (
964
+ childId = testChild_3.id,
965
+ arrived = HelsinkiDateTime .of(today, LocalTime .of(9 , 0 )),
966
+ departed = HelsinkiDateTime .of(today, LocalTime .of(14 , 0 )),
967
+ capacity = 1.0 ,
968
+ ),
963
969
ChildOccupancyAttendance (
964
970
childId = testChild_1.id,
965
971
arrived = HelsinkiDateTime .of(today, LocalTime .of(9 , 15 )),
@@ -972,12 +978,6 @@ class OccupancyControllerIntegrationTest : FullApplicationTest(resetDbBeforeEach
972
978
departed = null ,
973
979
capacity = 0.5 ,
974
980
),
975
- ChildOccupancyAttendance (
976
- childId = testChild_3.id,
977
- arrived = HelsinkiDateTime .of(today, LocalTime .of(9 , 0 )),
978
- departed = HelsinkiDateTime .of(today, LocalTime .of(14 , 0 )),
979
- capacity = 1.0 ,
980
- ),
981
981
),
982
982
staffAttendances =
983
983
listOf (
@@ -986,16 +986,16 @@ class OccupancyControllerIntegrationTest : FullApplicationTest(resetDbBeforeEach
986
986
departed = HelsinkiDateTime .of(today, LocalTime .of(14 , 0 )),
987
987
capacity = 7.0 ,
988
988
),
989
- StaffOccupancyAttendance (
990
- arrived = HelsinkiDateTime .of(today, LocalTime .of(10 , 0 )),
991
- departed = null ,
992
- capacity = 0.0 ,
993
- ),
994
989
StaffOccupancyAttendance (
995
990
arrived = HelsinkiDateTime .of(today, LocalTime .of(8 , 30 )),
996
991
departed = HelsinkiDateTime .of(today, LocalTime .of(15 , 0 )),
997
992
capacity = 7.0 ,
998
993
),
994
+ StaffOccupancyAttendance (
995
+ arrived = HelsinkiDateTime .of(today, LocalTime .of(10 , 0 )),
996
+ departed = null ,
997
+ capacity = 0.0 ,
998
+ ),
999
999
),
1000
1000
),
1001
1001
occupanciesForUnit,
@@ -1092,11 +1092,24 @@ class OccupancyControllerIntegrationTest : FullApplicationTest(resetDbBeforeEach
1092
1092
)
1093
1093
1094
1094
private fun getUnitRealizedOccupanciesForDay (date : LocalDate , groupIds : List <GroupId >? ) =
1095
- occupancyController.getUnitRealizedOccupanciesForDay(
1096
- dbInstance(),
1097
- AuthenticatedUser .Employee (testDecisionMaker_1.id, setOf (UserRole .SERVICE_WORKER )),
1098
- mockClock,
1099
- testDaycare.id,
1100
- OccupancyController .GetUnitOccupanciesForDayBody (date, groupIds),
1101
- )
1095
+ occupancyController
1096
+ .getUnitRealizedOccupanciesForDay(
1097
+ dbInstance(),
1098
+ AuthenticatedUser .Employee (testDecisionMaker_1.id, setOf (UserRole .SERVICE_WORKER )),
1099
+ mockClock,
1100
+ testDaycare.id,
1101
+ OccupancyController .GetUnitOccupanciesForDayBody (date, groupIds),
1102
+ )
1103
+ .let { occupancies ->
1104
+ occupancies.copy(
1105
+ childAttendances =
1106
+ occupancies.childAttendances.sortedWith(
1107
+ compareBy({ it.arrived }, { it.departed })
1108
+ ),
1109
+ staffAttendances =
1110
+ occupancies.staffAttendances.sortedWith(
1111
+ compareBy({ it.arrived }, { it.departed })
1112
+ ),
1113
+ )
1114
+ }
1102
1115
}
0 commit comments