diff --git a/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/CommonServiceTest.java b/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/CommonServiceTest.java index 90f74371..c02fe59d 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/CommonServiceTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/CommonServiceTest.java @@ -115,7 +115,7 @@ public void testGetSchoolClob() { assertThat(result).isNotNull(); assertThat(result.getSchoolId()).isEqualTo(schoolDetail.getSchoolId()); assertThat(result.getMinCode()).isEqualTo(schoolDetail.getMincode()); - assertThat(result.getSchoolCategoryCode()).isEqualTo(schoolCategoryLegacyCode); + assertThat(result.getSchoolCategoryLegacyCode()).isEqualTo(schoolCategoryLegacyCode); assertThat(result.getDistrictName()).isNotNull(); assertThat(result.getAddress1()).isNotNull(); } diff --git a/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/InstituteDistrictServiceTest.java b/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/InstituteDistrictServiceTest.java index 3f544659..701b793c 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/InstituteDistrictServiceTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/trax/service/institute/InstituteDistrictServiceTest.java @@ -333,7 +333,7 @@ public void whenGetDistrictByIdFromRedisCache_ReturnDistrict() { when(this.districtRedisRepository.findById("ID")) .thenReturn(Optional.of(districtEntity)); - when(this.districtTransformerMock.transformToDTO(Optional.of(districtEntity))) + when(this.districtTransformerMock.transformToDTO(districtEntity)) .thenReturn(district); assertEquals(district, districtService.getDistrictByIdFromRedisCache("ID")); } @@ -390,7 +390,7 @@ public void whenGetDistrictsBySchoolCategoryCode_ReturnDistricts() { schoolDetail.setSchoolId("ID"); schoolDetail.setDistrictId("DistID"); schoolDetail.setSchoolNumber("12345"); - schoolDetail.setSchoolCategoryCode("SCC"); + schoolDetail.setSchoolCategoryCode(schoolCategoryCode); schoolDetail.setEmail("abc@xyz.ca"); schoolDetails.add(schoolDetail); @@ -398,7 +398,7 @@ public void whenGetDistrictsBySchoolCategoryCode_ReturnDistricts() { schoolDetail.setSchoolId("ID"); schoolDetail.setDistrictId("DistID"); schoolDetail.setSchoolNumber("12345"); - schoolDetail.setSchoolCategoryCode("SCC"); + schoolDetail.setSchoolCategoryCode(schoolCategoryCode); schoolDetail.setEmail("abc@xyz.ca"); schoolDetails.add(schoolDetail); @@ -407,7 +407,7 @@ public void whenGetDistrictsBySchoolCategoryCode_ReturnDistricts() { schoolDetailEntity.setSchoolId("ID"); schoolDetailEntity.setDistrictId("DistID"); schoolDetailEntity.setSchoolNumber("12345"); - schoolDetailEntity.setSchoolCategoryCode("SCC"); + schoolDetailEntity.setSchoolCategoryCode(schoolCategoryCode); schoolDetailEntity.setEmail("abc@xyz.ca"); schoolDetailEntities.add(schoolDetailEntity); @@ -415,7 +415,7 @@ public void whenGetDistrictsBySchoolCategoryCode_ReturnDistricts() { schoolDetailEntity.setSchoolId("ID"); schoolDetailEntity.setDistrictId("DistID"); schoolDetailEntity.setSchoolNumber("12345"); - schoolDetailEntity.setSchoolCategoryCode("SCC"); + schoolDetailEntity.setSchoolCategoryCode(schoolCategoryCode); schoolDetailEntity.setEmail("abc@xyz.ca"); schoolDetailEntities.add(schoolDetailEntity); @@ -424,7 +424,9 @@ public void whenGetDistrictsBySchoolCategoryCode_ReturnDistricts() { .thenReturn(schoolDetailEntities); when(this.schoolDetailTransformer.transformToDTO(schoolDetailEntities)) .thenReturn(schoolDetails); - when(this.districtService.getDistrictByIdFromRedisCache("ID")) + when(this.districtRedisRepository.findById("DistID")) + .thenReturn(Optional.of(districtEntity)); + when(this.districtService.getDistrictByIdFromRedisCache("DistID")) .thenReturn(district); when(this.districtTransformerMock.transformToDTO(districtEntities)) .thenReturn(districts);