UploadedFileItem implements UploadedFile { @Override public String getFileName() { return FilenameUtils.getName(getFilePath()); } UploadedFileItem(FileItem item); @Override String getContentType(); @Override String getFileName(); @Override String getFilePath(); @Override long getSize(); @Override InputStream getStream(); @Override boolean isInMemory(); @Override void write(File file); void cleanup();  }
@Test public void fileNameExtractedFromFileItemName() throws Exception { FileItem item = newMock(FileItem.class); UploadedFileItem uploadedFile = new UploadedFileItem(item); expect(item.getName()).andReturn("foo/blah.txt"); replay(); assertEquals(uploadedFile.getFileName(), "blah.txt"); verify(); }