Skip to content

Commit d43f3b3

Browse files
committed
More fix
1 parent 2b0ab5b commit d43f3b3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreContainerTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void testExecuteMultipart(boolean doCopy) throws IOException {
250250
if (doCopy) {
251251
when(client.uploadPartCopy(uploadPartCopyRequestCaptor.capture())).thenAnswer(invocationOnMock -> {
252252
final UploadPartCopyRequest request = invocationOnMock.getArgument(0);
253-
return UploadPartCopyResponse.builder().copyPartResult(b -> b.eTag(expectedEtags.get(request.partNumber()))).build();
253+
return UploadPartCopyResponse.builder().copyPartResult(b -> b.eTag(expectedEtags.get(request.partNumber() - 1))).build();
254254
});
255255
} else {
256256
when(client.uploadPart(uploadPartRequestCaptor.capture(), uploadPartBodyCaptor.capture())).thenAnswer(invocationOnMock -> {
@@ -353,7 +353,6 @@ void testExecuteMultipart(boolean doCopy) throws IOException {
353353
public void testExecuteMultipartUploadAborted() {
354354
final String bucketName = randomAlphaOfLengthBetween(1, 10);
355355
final String blobName = randomAlphaOfLengthBetween(1, 10);
356-
final BlobPath blobPath = BlobPath.EMPTY;
357356

358357
final long blobSize = ByteSizeUnit.MB.toBytes(765);
359358
final long bufferSize = ByteSizeUnit.MB.toBytes(150);
@@ -423,7 +422,7 @@ public void close() {}
423422
blobContainer.executeMultipartUpload(randomPurpose(), blobStore, blobName, new ByteArrayInputStream(new byte[0]), blobSize);
424423
});
425424

426-
assertEquals("Unable to upload or copy object [" + blobName + "] using multipart upload", e.getMessage());
425+
assertEquals("Unable to upload object [" + blobName + "] using multipart upload", e.getMessage());
427426
assertThat(e.getCause(), instanceOf(S3Exception.class));
428427
assertEquals(exceptions.get(stage).getMessage(), e.getCause().getMessage());
429428

0 commit comments

Comments
 (0)