### Question:
RecommendationsRepository { public Map<String,Object> getGeneralRecommendationDetail(String recommendationId) throws DataException { Map<String,Object> recommendationDetail = new HashMap<>(); List<Map<String,Object>> resources = new ArrayList<>(); StringBuilder urlToQueryBuffer = new StringBuilder(esUrl).append("/").append("global_recommendations").append("/") .append("recommendation").append("/").append(Constants.SEARCH).append("?scroll=") .append(Constants.ES_PAGE_SCROLL_TTL); String urlToQuery = urlToQueryBuffer.toString(); String urlToScroll = new StringBuilder(esUrl).append("/").append(Constants.SEARCH).append("/scroll") .toString(); StringBuilder requestBody = new StringBuilder("{\"size\":10000,\"query\":{\"bool\":{\"must\":[{\"match\":{\"latest\":true}},{\"match\":{\"recommendationId.keyword\":\""); requestBody.append(recommendationId); requestBody.append("\"}}]}}}"); long totalDocs = getTotalDocCount("global_recommendations", "recommendation", "{" + requestBody.toString().substring(14)); String request = requestBody.toString(); String scrollId = null; if(totalDocs > 0){ for (int index = 0; index <= (totalDocs / Constants.ES_PAGE_SIZE); index++) { String responseDetails = null; try { if (StringUtils.isNotBlank(scrollId)) { request = elasticSearchRepository.buildScrollRequest(scrollId, Constants.ES_PAGE_SCROLL_TTL); urlToQuery = urlToScroll; } responseDetails = PacHttpUtils.doHttpPost(urlToQuery, request); scrollId = processResponseAndSendTheScrollBack(responseDetails, resources); } catch (Exception e) { } } } recommendationDetail.put("resources", resources); return recommendationDetail; }  List<Map<String,Object>> getRecommendationSummary(String assetGroup, String application); Map<String,Object> getSummaryByApplication(String assetGroup, String category); Map<String, Object> getSummaryByApplication(String assetGroup); Map<String,Object> getRecommendations(String assetGroup, String category, String application); Map<String,Object> getRecommendationDetail(String assetGroup, String recommendationId, String application); @SuppressWarnings("deprecation") Map<String,Object> getRecommendation(String recommendationId); List<Map<String,Object>> getGeneralRecommendationSummary(List<String> providers); Map<String,Object> getGeneralRecommendations(String category, List<String> providers); Map<String,Object> getGeneralRecommendationDetail(String recommendationId);  }### Answer:
@Test public void getGeneralRecommendationDetailTest() throws Exception { String response = "{\"_scroll_id\":\"id\",\"hits\":{\"hits\":[{\"_source\":{\"recommendation\":\"Route 53 recommendation\",\"recommendationId\":\"B913Ef6fb4\"," + "\"resourceinfo\":{\"Hosted Zone Name\":\"asdsd\",\"Hosted Zone ID\":\"asdad\",\"Resource Record Set Type\":\"name\"," + "\"Resource Record Set Identifier\":\"null\",\"Alias Target\":\"Load balancer\",\"Status\":\"Yellow\"},\"category\":\"performance\"," + "\"_loaddate\":\"2019-06-13T16:39:30+0530\",\"status\":\"warning\",\"latest\":true}}]}}"; String countresponse = "{\"count\":43}"; mockStatic(PacHttpUtils.class); when(PacHttpUtils.doHttpPost(anyString(), anyString())).thenReturn(countresponse,response); when(elasticSearchRepository.buildScrollRequest(anyString(), anyString())).thenReturn("request"); assertTrue(recommendationsRepository.getGeneralRecommendationDetail("id").size() == 1); }