Implemented JUnit-Test for upload: mocking stream and simulating timeout.