@Test
public void threadDidCleanupDeletesAllFileItems() throws Exception
{
HttpServletRequest request = mockHttpServletRequest();
MultipartDecoderImpl decoder = new MultipartDecoderImpl("/tmp", 888, -1, -1);
StubFileItem firstItem = new StubFileItem("one");
firstItem.setFormField(false);
StubFileItem secondItem = new StubFileItem("two");
secondItem.setFormField(false);
List<FileItem> fileItems = new ArrayList<FileItem>();
fileItems.add(firstItem);
fileItems.add(secondItem);
replay();
decoder.processFileItems(request, fileItems);
assertFalse(firstItem.isDeleted());
assertFalse(secondItem.isDeleted());
decoder.threadDidCleanup();
assertTrue(firstItem.isDeleted());
assertTrue(secondItem.isDeleted());
verify();
}