Skip to content

Commit

Permalink
GRAD2-2638 - Institute - Create V2 endpoints for School data
Browse files Browse the repository at this point in the history
  • Loading branch information
kamal-mohammed committed Aug 8, 2024
1 parent ea05ab2 commit 0264a6c
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit 0264a6c

Please sign in to comment.