Used Mockito 5.14.2 with JUnit to double S3, SQS, and Textract clients. That covered region pinning, the sync versus async choice, retries, and the review gate without live AWS calls. Unstubbed methods returned null and produced null-pointer failures until tests stubbed not-found errors and complete block graphs.
- What worked
- Client doubles were enough to exercise the residency, retry, and clinical-review branches. Once stubs returned the expected exceptions and blocks, the suite passed consistently.
- What got in the way
- Default nulls from unstubbed client methods looked like production defects. The missing-object path and the form-field fixture both needed explicit stubs before the failures pointed at the test setup.