diff --git a/api/src/test/java/ca/bc/gov/educ/api/trax/controller/SchoolControllerTest.java b/api/src/test/java/ca/bc/gov/educ/api/trax/controller/SchoolControllerTest.java index aae767c9..7d9f3134 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/trax/controller/SchoolControllerTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/trax/controller/SchoolControllerTest.java @@ -257,4 +257,18 @@ public void whenGetSchoolDetailsByMincode_ReturnsSchoolDetail() { schoolControllerV2.getSchoolDetailsByMincode(mincode); Mockito.verify(schoolServiceV2).getSchoolDetailByMincodeFromRedisCache(mincode); } + + @Test + public void whenGetSchoolDetailsByMincode_Return_NOT_FOUND() { + String mincode = "12345678"; + SchoolDetail schoolDetail = new SchoolDetail(); + schoolDetail.setSchoolId("1234567"); + schoolDetail.setDistrictId("9876543"); + schoolDetail.setMincode(mincode); + + Mockito.when(schoolServiceV2.getSchoolDetailByMincodeFromRedisCache(mincode)).thenReturn(null); + schoolControllerV2.getSchoolDetailsByMincode(mincode); + Mockito.verify(schoolServiceV2).getSchoolDetailByMincodeFromRedisCache(mincode); + assertEquals(responseHelper.NOT_FOUND(), schoolControllerV2.getSchoolDetailsByMincode(mincode)); + } }