Fix HTTP resource leaks, header inconsistencies, and add test coverage
...
- Close CloseableHttpResponse via try-with-resources in BaseService and
OauthService (previously only httpClient was closed, leaking response
entity streams on every call)
- Replace BufferedReader line-by-line read with IOUtils.toString to stop
silently dropping line breaks when reading HTTP response bodies
- Collapse identical OK/INVALID_REQUEST branches in BaseService.createResponse
- Extract duplicated header-builder logic from TrackingService/RateService
into BaseService.generateBearerHeaders, and apply it to AddressService
(which was missing the transId/transactionSrc headers the other two send)
- Add UNAUTHORIZED/FORBIDDEN/NOT_FOUND to HttpStatusCode so common UPS
error codes get a real description instead of null
- Fix CodeUtils.shippingServiceCodeToString(null) throwing NPE instead of
returning "Unknown" (Map.ofEntries rejects null key lookups)
- Guard AddressKeyFormat against a null postal code
- Remove pom.xml's pluginManagement override that hardcoded the compiler
to source/target 1.8, contradicting the Java 17 properties from the
prior upgrade commit and silently blocking newer language features
- Add Mockito-based unit tests for BaseService, OauthService,
TrackingService, RateService, AddressService, UpsApi, and CodeUtils
(test count: 3 -> 20)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>