Refactored the upload test