@@ -87,7 +87,14 @@ public void after() {
87
87
"INDIGENOUS_HEADCOUNT" ,
88
88
"BAND_RESIDENCE_HEADCOUNT" ,
89
89
"ELL_HEADCOUNT" ,
90
- "SPECIAL_EDUCATION_HEADCOUNT"
90
+ "SPECIAL_EDUCATION_HEADCOUNT" ,
91
+ "ALL_STUDENT_SCHOOL_CSV" ,
92
+ "ALL_STUDENT_ERRORS_WARNS_SCHOOL_CSV" ,
93
+ "ALL_STUDENT_FRENCH_SCHOOL_CSV" ,
94
+ "ALL_STUDENT_CAREER_SCHOOL_CSV" ,
95
+ "ALL_STUDENT_INDIGENOUS_SCHOOL_CSV" ,
96
+ "ALL_STUDENT_INCLUSIVE_SCHOOL_CSV" ,
97
+ "ALL_STUDENT_ELL_SCHOOL_CSV"
91
98
})
92
99
void testGetGradeEnrollmentHeadcountReport_ShouldReturnCollection (String reportTypeCode ) throws Exception {
93
100
final GrantedAuthority grantedAuthority = () -> "SCOPE_READ_SDC_COLLECTION" ;
@@ -125,6 +132,56 @@ void testGetGradeEnrollmentHeadcountReport_ShouldReturnCollection(String reportT
125
132
.andDo (print ()).andExpect (status ().isOk ());
126
133
}
127
134
135
+ @ ParameterizedTest
136
+ @ CsvSource ({
137
+ "ALL_STUDENT_DIS_CSV" ,
138
+ "ALL_STUDENT_ERRORS_WARNS_DIS_CSV" ,
139
+ "ALL_STUDENT_FRENCH_DIS_CSV" ,
140
+ "ALL_STUDENT_CAREER_DIS_CSV" ,
141
+ "ALL_STUDENT_INDIGENOUS_DIS_CSV" ,
142
+ "ALL_STUDENT_INCLUSIVE_DIS_CSV" ,
143
+ "ALL_STUDENT_ELL_DIS_CSV"
144
+ })
145
+ void testAllDistrictCsvReports_ShouldReturnCollection (String reportTypeCode ) throws Exception {
146
+ final GrantedAuthority grantedAuthority = () -> "SCOPE_READ_SDC_COLLECTION" ;
147
+ final SecurityMockMvcRequestPostProcessors .OidcLoginRequestPostProcessor mockAuthority = oidcLogin ().authorities (grantedAuthority );
148
+
149
+ var district = this .createMockDistrict ();
150
+ when (this .restUtils .getDistrictByDistrictID (anyString ())).thenReturn (Optional .of (district ));
151
+ var schoolMock = this .createMockSchool ();
152
+ when (this .restUtils .getSchoolBySchoolID (anyString ())).thenReturn (Optional .of (schoolMock ));
153
+
154
+ CollectionEntity collection = createMockCollectionEntity ();
155
+ collection .setCloseDate (LocalDateTime .now ().plusDays (2 ));
156
+ collectionRepository .save (collection );
157
+
158
+ SdcDistrictCollectionEntity sdcMockDistrict = createMockSdcDistrictCollectionEntity (collection , UUID .fromString (district .getDistrictId ()));
159
+ sdcMockDistrict = sdcDistricCollectionRepository .save (sdcMockDistrict );
160
+
161
+ SchoolTombstone schoolTombstone = createMockSchool ();
162
+ SdcSchoolCollectionEntity sdcMockSchool = createMockSdcSchoolCollectionEntity (collection , UUID .fromString (schoolTombstone .getSchoolId ()));
163
+ sdcMockSchool .setUploadDate (null );
164
+ sdcMockSchool .setUploadFileName (null );
165
+ sdcMockSchool .setSdcDistrictCollectionID (sdcMockDistrict .getSdcDistrictCollectionID ());
166
+ sdcMockSchool = sdcSchoolCollectionRepository .save (sdcMockSchool );
167
+
168
+ SdcSchoolCollectionStudentEntity student1 = createMockSchoolStudentEntity (sdcMockSchool );
169
+ student1 .setIsSchoolAged (true );
170
+ student1 .setFte (new BigDecimal (1.0 ));
171
+ sdcSchoolCollectionStudentRepository .save (student1 );
172
+
173
+ SdcSchoolCollectionStudentEntity student2 = createMockSchoolStudentEntity (sdcMockSchool );
174
+ student2 .setBandCode ("0600" );
175
+ student2 .setIsSchoolAged (false );
176
+ student2 .setIsAdult (true );
177
+ student2 .setFte (new BigDecimal (2.0 ));
178
+ sdcSchoolCollectionStudentRepository .save (student2 );
179
+
180
+ this .mockMvc .perform (
181
+ get (URL .BASE_URL_REPORT_GENERATION + "/sdcDistrictCollection/" + sdcMockDistrict .getSdcDistrictCollectionID () + "/" + reportTypeCode ).with (mockAuthority ))
182
+ .andDo (print ()).andExpect (status ().isOk ());
183
+ }
184
+
128
185
@ Test
129
186
void testGetFrenchProgramHeadcountReportCSF_ShouldReturnCollection () throws Exception {
130
187
final GrantedAuthority grantedAuthority = () -> "SCOPE_READ_SDC_COLLECTION" ;
0 commit comments