services
services copied to clipboard
Add new file tests to OdkWebserverServiceTest
Pull Request Description:
This pull request introduces several changes to the OdkWebserverServiceTest
class in the org.opendatakit.webkitserver.service
package. Here's a summary of the changes:
1. Added Permission Rules:
- Added GrantPermissionRule for
WRITE_EXTERNAL_STORAGE
andREAD_EXTERNAL_STORAGE
permissions to the test class.
2. Updated Test Methods:
-
Updated test methods to create and serve various types of files and handle different scenarios, including serving HTML files, empty files, large files, files with special characters in their names, files with spaces in their names, files with Unicode characters in their content, files with invalid extensions, files with uppercase extensions, binary files, files with multiple dots in their names, files with no extension, and files with different extensions.
-
Added assertions to verify the responses from the web server for each test scenario.
3. Refactored Code:
- Refactored some methods for improved readability and maintainability.
- Cleaned up imports and removed unused imports.
4. Miscellaneous Changes:
- Updated comments for better clarity and documentation.
- Removed unnecessary exception printing and added fail messages for better error reporting in tests.
Tags @wbrunette @Lamouresparus