From 0264a6c53f930a1a91cff90c96b9087cee9af183 Mon Sep 17 00:00:00 2001 From: Kamal Mohammed Date: Thu, 8 Aug 2024 09:13:00 -0600 Subject: [PATCH] GRAD2-2638 - Institute - Create V2 endpoints for School data --- .../api/trax/controller/SchoolControllerTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)); + } }