Program: 47353
Project: 47353
Buggy source:
/** 
 * @param fileName
 * @param withManifest
 * @param expectedZipEntryName
 * @throws Throwable
 */
public void assertDoGetFileOrDirAsDownload(final String fileName,final String withManifest,final String expectedZipEntryName) throws Throwable {
  IAuthorizationPolicy mockAuthPolicy=mock(IAuthorizationPolicy.class);
  doReturn(true).when(mockAuthPolicy).isAllowed(anyString());
  BaseExportProcessor mockExportProcessor=mock(BaseExportProcessor.class);
  File mockExportFile=mock(File.class);
  ExportHandler mockExportHandler=mock(ExportHandler.class);
  StreamingOutput mockStream=mock(StreamingOutput.class);
  RepositoryFile mockRepoFile=mock(RepositoryFile.class);
  doReturn(fileName).when(mockRepoFile).getName();
  doReturn(mockExportFile).when(mockExportProcessor).performExport(mockRepoFile);
  doReturn(mockRepoFile).when(fileService.repository).getFile(anyString());
  doReturn(mockAuthPolicy).when(fileService).getPolicy();
  doReturn(mockExportProcessor).when(fileService).getDownloadExportProcessor(anyString(),anyBoolean(),anyBoolean());
  doReturn(mockExportHandler).when(fileService).getDownloadExportHandler();
  doReturn(mockStream).when(fileService).getDownloadStream(mockRepoFile,mockExportProcessor);
  FileService.DownloadFileWrapper wrapper=fileService.doGetFileOrDirAsDownload("String_Node_Str","String_Node_Str" + fileName,withManifest);
  verify(fileService.repository,times(1)).getFile(anyString());
  assertEquals(mockStream,wrapper.getOutputStream());
  assertEquals(expectedZipEntryName + "String_Node_Str",wrapper.getEncodedFileName());
  assertEquals("String_Node_Str" + fileName + "String_Node_Str",wrapper.getAttachment());
}

Fixed version (ground truth):
/** 
 * @param fileName
 * @param withManifest
 * @param expectedEncodedFileName
 * @param expectedFileName 
 * @throws Throwable
 */
public void assertDoGetFileOrDirAsDownload(final String fileName,final String withManifest,final String expectedEncodedFileName,final String expectedFileName) throws Throwable {
  IAuthorizationPolicy mockAuthPolicy=mock(IAuthorizationPolicy.class);
  doReturn(true).when(mockAuthPolicy).isAllowed(anyString());
  BaseExportProcessor mockExportProcessor=mock(BaseExportProcessor.class);
  File mockExportFile=mock(File.class);
  ExportHandler mockExportHandler=mock(ExportHandler.class);
  StreamingOutput mockStream=mock(StreamingOutput.class);
  RepositoryFile mockRepoFile=mock(RepositoryFile.class);
  doReturn(fileName).when(mockRepoFile).getName();
  doReturn(mockExportFile).when(mockExportProcessor).performExport(mockRepoFile);
  doReturn(mockRepoFile).when(fileService.repository).getFile(anyString());
  doReturn(mockAuthPolicy).when(fileService).getPolicy();
  doReturn(mockExportProcessor).when(fileService).getDownloadExportProcessor(anyString(),anyBoolean(),anyBoolean());
  doReturn(mockExportHandler).when(fileService).getDownloadExportHandler();
  doReturn(mockStream).when(fileService).getDownloadStream(mockRepoFile,mockExportProcessor);
  FileService.DownloadFileWrapper wrapper=fileService.doGetFileOrDirAsDownload("String_Node_Str","String_Node_Str" + fileName,withManifest);
  verify(fileService.repository,times(1)).getFile(anyString());
  assertEquals(mockStream,wrapper.getOutputStream());
  assertEquals(expectedEncodedFileName,wrapper.getEncodedFileName());
  assertEquals("String_Node_Str" + expectedFileName + "String_Node_Str",wrapper.getAttachment());
}