Newer
Older
fedex-api / TODO.md

TODO

  • Run codebase analysis: bugs, code reuse opportunities, unit test gaps, other issues
  • Branch fix/service-bugs-and-test-coverage created off master
  • Fix bugs found during analysis:
    • Unclosed CloseableHttpResponse leak in every service call (BaseService/Oauth/Rate/Tracking/Address)
    • KNOWN_CODES vs HttpStatusCode mismatch (429/422 now reconciled into KNOWN_CODES)
    • Copy-pasted "Tracking Error" label in AddressService -> "Validation Error"
    • BaseService.parse swallowed JsonProcessingException cause -> now chained
    • ValidationRequest.AddressToValidate non-static inner class broke JSON deserialization -> made static
    • RequestedShipment / Commodity missing no-args constructor (Lombok @Builder without @NoArgsConstructor) broke RateRequest deserialization -> added constructors
    • trackingResponse.json fixture had alerts as a string instead of array -> fixed fixture
    • Added OAuth token caching in FedexApi (was fetching a new token on every call)
  • Refactored RateService/TrackingService/AddressService duplication into BaseService.post() + ApiResponse interface
  • Added tests: HttpStatusCodeTest, BaseServiceTest, OauthServiceTest, RateServiceTest, TrackingServiceTest, AddressServiceTest, FedexApiTest, RateRequestTest, TrackingResponseTest, ValidationRequestTest, ValidationResponseTest; strengthened OauthResponseTest error-path assertions; added TrackingFactory boundary tests
    • Full test suite green: 47/47 passing, mvn package clean
    • --> Awaiting user review/commit decision (no commit made yet, working tree has uncommitted changes on the new branch)

Notes

  • Project: io.ljunggren.fedex.api — FedEx API client library (Maven/Lombok)
  • Structure: small set of service classes (BaseService, OauthService, RateService, TrackingService, AddressService), one factory (TrackingFactory), one util (ServiceTypeUtils), and a large set of model/DTO classes for rate/tracking/address request & response payloads.
  • Existing tests: OauthResponseTest, TrackingFactoryTest, TrackingRequestTest, RateResponseTest — coverage looks thin relative to the number of model/service classes.