@@ -331,6 +331,7 @@ void testProcessFteCalculator_DistrictDoubleReported() {
331
331
332
332
this .studentData .getSchool ().setSchoolId (sdcSchoolCollectionEntityOrig .getSchoolID ().toString ());
333
333
this .studentData .getSchool ().setDistrictId (String .valueOf (districtID ));
334
+ this .studentData .getSchool ().setIndependentAuthorityId (null );
334
335
SdcSchoolCollectionStudentEntity sdcSchoolCollectionStudentEntity = createMockSchoolStudentForSagaEntity (sdcSchoolCollectionEntityOrig );
335
336
336
337
sdcSchoolCollectionStudentEntity .setEnrolledGradeCode ("08" );
@@ -341,7 +342,7 @@ void testProcessFteCalculator_DistrictDoubleReported() {
341
342
var oldCollection = createMockCollectionEntity ();
342
343
var oldSnapDate = LocalDate .of (LocalDateTime .now ().minusYears (1 ).getYear (), Month .SEPTEMBER , 29 );
343
344
oldCollection .setSnapshotDate (oldSnapDate );
344
- var oldSdcCollection = createMockSdcSchoolCollectionEntity (oldCollection , null );
345
+ var oldSdcCollection = createMockSdcSchoolCollectionEntity (oldCollection , sdcSchoolCollectionEntityOrig . getSchoolID () );
345
346
collectionRepository .save (oldCollection );
346
347
var oldDistrictColl = sdcDistrictCollectionRepository .save (createMockSdcDistrictCollectionEntity (oldCollection , districtID ));
347
348
oldSdcCollection .setSdcDistrictCollectionID (oldDistrictColl .getSdcDistrictCollectionID ());
@@ -358,6 +359,7 @@ void testProcessFteCalculator_DistrictDoubleReported() {
358
359
penMatchResult .getMatchingRecords ().get (0 ).setStudentID (oneYearAgoCollectionStudent .getAssignedStudentId ().toString ());
359
360
when (this .restUtils .getPenMatchResult (any (),any (), any ())).thenReturn (penMatchResult );
360
361
when (this .restUtils .getMergedStudentIds (any (), any ())).thenReturn (List .of (studentMerge ));
362
+ when (restUtils .getAllSchoolTombstones ()).thenReturn (List .of (this .studentData .getSchool ()));
361
363
FteCalculationResult result = fteCalculatorChainProcessor .processFteCalculator (studentData );
362
364
363
365
// Then
@@ -390,6 +392,7 @@ void testProcessFteCalculator_DistrictDoubleReported_GivenMergedStudent_ReturnsZ
390
392
391
393
this .studentData .getSchool ().setSchoolId (sdcSchoolCollectionEntityOrig .getSchoolID ().toString ());
392
394
this .studentData .getSchool ().setDistrictId (String .valueOf (districtID ));
395
+ this .studentData .getSchool ().setIndependentAuthorityId (null );
393
396
SdcSchoolCollectionStudentEntity sdcSchoolCollectionStudentEntity = createMockSchoolStudentForSagaEntity (sdcSchoolCollectionEntityOrig );
394
397
395
398
sdcSchoolCollectionStudentEntity .setEnrolledGradeCode ("08" );
@@ -400,7 +403,7 @@ void testProcessFteCalculator_DistrictDoubleReported_GivenMergedStudent_ReturnsZ
400
403
var oldCollection = createMockCollectionEntity ();
401
404
var oldSnapDate = LocalDate .of (LocalDateTime .now ().minusYears (1 ).getYear (), Month .SEPTEMBER , 29 );
402
405
oldCollection .setSnapshotDate (oldSnapDate );
403
- var oldSdcCollection = createMockSdcSchoolCollectionEntity (oldCollection , null );
406
+ var oldSdcCollection = createMockSdcSchoolCollectionEntity (oldCollection , sdcSchoolCollectionEntityOrig . getSchoolID () );
404
407
collectionRepository .save (oldCollection );
405
408
var oldDistrictColl = sdcDistrictCollectionRepository .save (createMockSdcDistrictCollectionEntity (oldCollection , districtID ));
406
409
oldSdcCollection .setSdcDistrictCollectionID (oldDistrictColl .getSdcDistrictCollectionID ());
@@ -420,6 +423,7 @@ void testProcessFteCalculator_DistrictDoubleReported_GivenMergedStudent_ReturnsZ
420
423
penMatchResult .getMatchingRecords ().get (0 ).setStudentID (oneYearAgoCollectionStudent .getAssignedStudentId ().toString ());
421
424
when (this .restUtils .getPenMatchResult (any (),any (), any ())).thenReturn (penMatchResult );
422
425
when (this .restUtils .getMergedStudentIds (any (), any ())).thenReturn (List .of (studentMerge ));
426
+ when (restUtils .getAllSchoolTombstones ()).thenReturn (List .of (this .studentData .getSchool ()));
423
427
FteCalculationResult result = fteCalculatorChainProcessor .processFteCalculator (studentData );
424
428
425
429
// Then
0 commit comments