File tree Expand file tree Collapse file tree
src/test/java/com/maxmind/minfraud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -583,10 +583,17 @@ public void testRetriesExhausted() {
583583
584584 // 1 initial attempt + 2 retries.
585585 wireMock .verify (3 , postRequestedFor (urlEqualTo (url )));
586- // The final exception should carry the prior failures as suppressed
587- // exceptions so the full retry history is visible in stack traces.
588- assertEquals (2 , ex .getSuppressed ().length ,
589- "expected the 2 prior IOExceptions to be attached as suppressed" );
586+ // The full retry history is reachable via the suppressed chain: each
587+ // exception carries its immediate predecessor as a suppressed
588+ // exception. Walk the chain and confirm we have 2 priors.
589+ int priorCount = 0 ;
590+ Throwable cur = ex ;
591+ while (cur .getSuppressed ().length > 0 ) {
592+ cur = cur .getSuppressed ()[0 ];
593+ priorCount ++;
594+ }
595+ assertEquals (2 , priorCount ,
596+ "expected the 2 prior IOExceptions in the suppressed chain" );
590597 }
591598
592599 @ Test
You can’t perform that action at this time.
0 commit comments