|
15 | 15 | import static org.junit.jupiter.api.Assertions.assertNull; |
16 | 16 | import static org.junit.jupiter.api.Assertions.assertThrows; |
17 | 17 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 18 | +import static org.junit.jupiter.api.Assertions.fail; |
18 | 19 |
|
19 | 20 | import com.github.tomakehurst.wiremock.http.Fault; |
20 | 21 | import com.github.tomakehurst.wiremock.junit5.WireMockExtension; |
21 | 22 | import com.github.tomakehurst.wiremock.junit5.WireMockTest; |
22 | 23 | import com.github.tomakehurst.wiremock.stubbing.Scenario; |
| 24 | +import com.github.tomakehurst.wiremock.verification.LoggedRequest; |
23 | 25 | import com.maxmind.geoip2.exception.AddressNotFoundException; |
24 | 26 | import com.maxmind.geoip2.exception.AuthenticationException; |
25 | 27 | import com.maxmind.geoip2.exception.GeoIp2Exception; |
@@ -665,7 +667,19 @@ public void testMaxRetriesZeroDisablesRetry() { |
665 | 667 | assertThrows(Exception.class, |
666 | 668 | () -> client.insights(InetAddress.getByName("1.2.3.4"))); |
667 | 669 |
|
668 | | - wireMock.verify(1, getRequestedFor(urlEqualTo(url))); |
| 670 | + // DIAGNOSTIC: dump full request details on mismatch so we can |
| 671 | + // distinguish JDK-internal retry from h2c upgrade fallback. To be |
| 672 | + // reverted once the windows-21 wire-count behavior is understood. |
| 673 | + List<LoggedRequest> requests = wireMock.findAll(getRequestedFor(urlEqualTo(url))); |
| 674 | + if (requests.size() != 1) { |
| 675 | + StringBuilder sb = new StringBuilder("Expected 1 request, got ") |
| 676 | + .append(requests.size()).append(":\n"); |
| 677 | + for (int i = 0; i < requests.size(); i++) { |
| 678 | + sb.append("--- Request ").append(i + 1).append(" ---\n") |
| 679 | + .append(requests.get(i).toString()).append("\n"); |
| 680 | + } |
| 681 | + fail(sb.toString()); |
| 682 | + } |
669 | 683 | } |
670 | 684 |
|
671 | 685 | @Test |
|
0 commit comments