@Test public void testDownloadFileWhenTheFileNotExistsOnThePath() throws IOException { given(response.getOutputStream()).willReturn(outputStream); underTest.downloadFile("src/test/resources/testreq.txt", response); verify(response).setHeader(Mockito.anyString(), Mockito.anyString()); verify(response).setContentType(Mockito.anyString()); }
@RequestMapping(value = "/downloadFile", method = RequestMethod.GET) public void downloadFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response) { addFileToResponse(filePath, response, true); }
ResultFileDownloadController { @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) public void downloadFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response) { addFileToResponse(filePath, response, true); } }
ResultFileDownloadController { @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) public void downloadFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response) { addFileToResponse(filePath, response, true); }  }
ResultFileDownloadController { @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) public void downloadFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response) { addFileToResponse(filePath, response, true); }  @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) void downloadFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response); @RequestMapping(value = "/openFile", method = RequestMethod.GET) void openFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response); }
ResultFileDownloadController { @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) public void downloadFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response) { addFileToResponse(filePath, response, true); }  @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) void downloadFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response); @RequestMapping(value = "/openFile", method = RequestMethod.GET) void openFile(@RequestParam(value = "filePath") final String filePath, final HttpServletResponse response);  }