diff --git a/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java b/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java index 1f843e2aea168..e49941efa1e70 100644 --- a/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java +++ b/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java @@ -129,9 +129,9 @@ public void handle(final HttpExchange exchange) throws IOException { throw new AssertionError("Range header does not match expected format: " + range); } - final int start = Integer.parseInt(matcher.group(1)); - final int end = Integer.parseInt(matcher.group(2)); - var responseBlob = blob.slice(start, Math.min(end - start + 1, blob.length() - start)); + final long start = Long.parseLong(matcher.group(1)); + final long end = Long.parseLong(matcher.group(2)); + var responseBlob = blob.slice(Math.toIntExact(start), Math.toIntExact(Math.min(end - start + 1, blob.length() - start))); exchange.getResponseHeaders().add("Content-Type", "application/octet-stream"); exchange.getResponseHeaders().add("x-ms-blob-content-length", String.valueOf(responseBlob.length()));