@Test
public void withFilesAndFields() throws Exception {

	final List<FileItem> elements = new ArrayList<FileItem>();
	elements.add(new MockFileItem("foo", "blah"));
	elements.add(new MockFileItem("bar", "blah blah"));
	elements.add(new MockFileItem("thefile0", "foo.txt", "foo".getBytes()));
	elements.add(new MockFileItem("thefile1", "bar.txt", "bar".getBytes()));

	interceptor = new CommonsUploadMultipartInterceptor(request, parameters, config, validator, mockCreator);

	when(request.getContentType()).thenReturn("multipart/form-data");
	when(request.getMethod()).thenReturn("POST");
	when(mockUpload.parseRequest(request)).thenReturn(elements);

	interceptor.intercept(stack, method, instance);

	verify(parameters).setParameter("foo", "blah");
	verify(parameters).setParameter("bar", "blah blah");
	
	verify(parameters).setParameter("thefile0", "thefile0");
	verify(parameters).setParameter("thefile1", "thefile1");
	
	verify(request).setAttribute(eq("thefile0"), any(UploadedFile.class));
	verify(request).setAttribute(eq("thefile1"), any(UploadedFile.class));
}