UploadedFileItem implements UploadedFile { @Override public String getFilePath() { return item.getName(); } 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 filePathIsFileItemName() throws Exception { FileItem item = newMock(FileItem.class); UploadedFileItem uploadedFile = new UploadedFileItem(item); expect(item.getName()).andReturn("foo/blah.txt"); replay(); assertEquals(uploadedFile.getFilePath(), "foo/blah.txt"); verify(); }