Skip to content

Commit db288f0

Browse files
committed
fix tests
1 parent ba9a0bd commit db288f0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

api/src/test/java/ca/bc/gov/educ/studentdatacollection/api/controller/v1/SdcDuplicateControllerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ void testUpdateStudentAndResolveProvDuplicates_typeCHANGE_GRADE_shouldSetDuplica
225225
sdcSchoolCollectionEntity2.setSdcDistrictCollectionID(sdcDistrictCollectionID);
226226
sdcSchoolCollectionRepository.save(sdcSchoolCollectionEntity2);
227227

228+
when(this.restUtils.getAllSchoolTombstones()).thenReturn(List.of(schoolTombstone1, schoolTombstone2));
228229
when(this.restUtils.getSchoolBySchoolID(schoolTombstone1.getSchoolId())).thenReturn(Optional.of(schoolTombstone1));
229230
when(this.restUtils.getSchoolBySchoolID(schoolTombstone2.getSchoolId())).thenReturn(Optional.of(schoolTombstone2));
230231
when(this.restUtils.getGradStatusResult(any(), any())).thenReturn(GradStatusResult.builder().build());

api/src/test/java/ca/bc/gov/educ/studentdatacollection/api/controller/v1/SdcFileControllerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@
3131

3232
import java.io.FileInputStream;
3333
import java.time.LocalDateTime;
34-
import java.util.Arrays;
35-
import java.util.Base64;
36-
import java.util.Optional;
37-
import java.util.UUID;
34+
import java.util.*;
3835

3936
import static ca.bc.gov.educ.studentdatacollection.api.constants.v1.URL.BASE_URL;
4037
import static org.assertj.core.api.Assertions.assertThat;
@@ -275,6 +272,9 @@ void testProcessSdcFNCharsFile_givenValidPayload_ShouldReturnStatusOk() throws E
275272
final String fileContents = Base64.getEncoder().encodeToString(IOUtils.toByteArray(fis));
276273
assertThat(fileContents).isNotEmpty();
277274
val body = SdcFileUpload.builder().fileContents(fileContents).createUser("ABC").fileName("SampleUpload.std").build();
275+
276+
when(this.restUtils.getAllSchoolTombstones()).thenReturn(List.of(school));
277+
278278
this.mockMvc.perform(post(BASE_URL + "/" + sdcSchoolCollection.getSdcSchoolCollectionID().toString() + "/file")
279279
.with(jwt().jwt(jwt -> jwt.claim("scope", "WRITE_SDC_COLLECTION")))
280280
.header("correlationID", UUID.randomUUID().toString())

0 commit comments

Comments
 (0)