### Question:
FileDownloadService { public void performFileDownload() throws FileDownloadException { fileDownloader.setMimeContentType(content.getMimeContentType()); fileDownloader.setContentFileName(getContentFileNameWithoutExt() + content.getContentFileNameExt()); fileDownloader.download(content.getInputStream()); } FileDownloadService(ContentKeeper content, FileDownloader fileDownloader, String contentFileNameWithoutExt); void performFileDownload();  }### Answer:
@Test public void performFileDownloadTest() throws Exception { InputStream mockInputStream = mock(InputStream.class); when(mockContentKeeper.getContentFileNameExt()).thenReturn(".sql"); when(mockContentKeeper.getMimeContentType()).thenReturn("MIME_TYPE"); when(mockContentKeeper.getInputStream()).thenReturn(mockInputStream); sut = new FileDownloadService(mockContentKeeper, mockFileDownloader, "jtalks"); sut.performFileDownload(); verify(mockFileDownloader).setMimeContentType("MIME_TYPE"); verify(mockFileDownloader).setContentFileName(sut.getContentFileNameWithoutExt() + ".sql"); verify(mockFileDownloader).download(mockInputStream); }