@Test public void testDownloadFilesWithoutSearchingResult() throws ServletException, IOException { List<List<String>> list = new ArrayList<>(); given(session.getAttribute(SEARCH_RESULT_KEY)).willReturn(list); given(response.getOutputStream()).willReturn(outputStream); underTest.downloadFiles(session, response); verify(fileZipper, times(0)).createZipWithFiles(list, outputStream); }
@SuppressWarnings("unchecked") @RequestMapping(value = "/downloadAll") public void downloadFiles(final HttpSession session, final HttpServletResponse response) { List<List<String>> searchResultWithPairs = (List<List<String>>) session.getAttribute(SEARCH_RESULT_KEY); if (searchResultWithPairs != null && !searchResultWithPairs.isEmpty()) { writeZipToResponse(response, searchResultWithPairs); clearSearchResultFromSession(session); } }
AllResultFileDownloadController { @SuppressWarnings("unchecked") @RequestMapping(value = "/downloadAll") public void downloadFiles(final HttpSession session, final HttpServletResponse response) { List<List<String>> searchResultWithPairs = (List<List<String>>) session.getAttribute(SEARCH_RESULT_KEY); if (searchResultWithPairs != null && !searchResultWithPairs.isEmpty()) { writeZipToResponse(response, searchResultWithPairs); clearSearchResultFromSession(session); } } }
AllResultFileDownloadController { @SuppressWarnings("unchecked") @RequestMapping(value = "/downloadAll") public void downloadFiles(final HttpSession session, final HttpServletResponse response) { List<List<String>> searchResultWithPairs = (List<List<String>>) session.getAttribute(SEARCH_RESULT_KEY); if (searchResultWithPairs != null && !searchResultWithPairs.isEmpty()) { writeZipToResponse(response, searchResultWithPairs); clearSearchResultFromSession(session); } }  }
AllResultFileDownloadController { @SuppressWarnings("unchecked") @RequestMapping(value = "/downloadAll") public void downloadFiles(final HttpSession session, final HttpServletResponse response) { List<List<String>> searchResultWithPairs = (List<List<String>>) session.getAttribute(SEARCH_RESULT_KEY); if (searchResultWithPairs != null && !searchResultWithPairs.isEmpty()) { writeZipToResponse(response, searchResultWithPairs); clearSearchResultFromSession(session); } }  @SuppressWarnings("unchecked") @RequestMapping(value = "/downloadAll") void downloadFiles(final HttpSession session, final HttpServletResponse response); }
AllResultFileDownloadController { @SuppressWarnings("unchecked") @RequestMapping(value = "/downloadAll") public void downloadFiles(final HttpSession session, final HttpServletResponse response) { List<List<String>> searchResultWithPairs = (List<List<String>>) session.getAttribute(SEARCH_RESULT_KEY); if (searchResultWithPairs != null && !searchResultWithPairs.isEmpty()) { writeZipToResponse(response, searchResultWithPairs); clearSearchResultFromSession(session); } }  @SuppressWarnings("unchecked") @RequestMapping(value = "/downloadAll") void downloadFiles(final HttpSession session, final HttpServletResponse response);  }