Skip to content

Commit 977e439

Browse files
committed
Fix testReadFromPositionLargerThanBlobLength
1 parent b56d489 commit 977e439

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/repository-s3/qa/third-party/src/test/java/org/elasticsearch/repositories/s3/S3RepositoryThirdPartyTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ List<MultipartUpload> listMultipartUploads() {
223223
}
224224

225225
public void testReadFromPositionLargerThanBlobLength() {
226-
testReadFromPositionLargerThanBlobLength(
227-
e -> Integer.parseInt(
228-
asInstanceOf(S3Exception.class, e.getCause()).awsErrorDetails().errorCode()
229-
) == RestStatus.REQUESTED_RANGE_NOT_SATISFIED.getStatus()
230-
);
226+
testReadFromPositionLargerThanBlobLength(e -> {
227+
final var s3Exception = asInstanceOf(S3Exception.class, e.getCause());
228+
return s3Exception.statusCode() == RestStatus.REQUESTED_RANGE_NOT_SATISFIED.getStatus()
229+
&& "InvalidRange".equals(s3Exception.awsErrorDetails().errorCode());
230+
});
231231
}
232232
}

0 commit comments

Comments
 (0)