* Add unit tests for ShadowsocksFmt protocol formatter
- Add comprehensive test coverage for Shadowsocks URL parsing
- Test SIP002 format (modern) with base64 encoded userinfo
- Test legacy format with full base64 encoding
- Test URI generation and round-trip consistency
- Cover edge cases: IPv6 addresses, empty remarks, various encryption methods
- Mock Android Base64 and Log classes for unit test execution
* Adding URL decoding before Base64 decoding. The flow is now: extract → URL decode → Base64 decode.
* Fix test naming convention to match project standards
Change test method names from backtick-delimited descriptive names
to underscore-separated format with test_ prefix to align with
existing project conventions (e.g., test_parseInt in UtilsTest).
Before: `parseSip002 valid URL with base64 encoded userinfo`()
After: test_parseSip002_validUrlWithBase64EncodedUserinfo()
* Fix Base64 mock to properly handle encoding flags
The mock now inspects the flags parameter and applies URL-safe
encoding and padding removal conditionally based on actual flag
values (URL_SAFE, NO_PADDING) instead of unconditionally using
withoutPadding().
* Fix Base64 decode mock to propagate exceptions
The mock now properly handles the URL_SAFE flag and propagates
exceptions on invalid input instead of silently returning an
empty ByteArray. This matches Android's actual Base64 behavior
where IllegalArgumentException is thrown on invalid input.
* Extract helper functions to reduce code duplication
Add createSip002Url() and createLegacyUrl() helper functions to
centralize URL construction logic. Add SS_SCHEME constant to
avoid magic strings. This improves maintainability by reducing
repeated Base64 encoding and URL construction patterns.
* Add URI format verification before extracting base64
Verify that toUri() returns a URI string without the scheme
prefix before extracting the base64 content. This ensures the
test correctly validates the URI format and prevents incorrect
data extraction if the implementation changes.
* Add scheme verification in round-trip test
Explicitly verify that toUri() returns a URI string without the
scheme prefix before prepending it. This documents the expected
behavior and ensures the test fails gracefully if the
implementation changes.
* mockito-inline version 6.1.0 does not exist
- The latest available version is 5.2.0 (released March 2023)
- The mockito-inline artifact was effectively deprecated after 5.2.0; mocking final classes is now built into mockito-core since Mockito 5.x