kopia lustrzana https://github.com/gaul/s3proxy
Assert expected content length
This makes some errors more obvious than comparing the content data.pull/101/head
rodzic
4a4d2f7e6a
commit
01c43c9f1b
|
@ -204,6 +204,8 @@ public final class S3AwsSdkTest {
|
|||
|
||||
S3Object object = client.getObject(new GetObjectRequest(containerName,
|
||||
targetBlobName));
|
||||
assertThat(object.getObjectMetadata().getContentLength()).isEqualTo(
|
||||
BYTE_SOURCE.size());
|
||||
try (InputStream actual = object.getObjectContent();
|
||||
InputStream expected = BYTE_SOURCE.openStream()) {
|
||||
assertThat(actual).hasContentEqualTo(expected);
|
||||
|
@ -256,6 +258,8 @@ public final class S3AwsSdkTest {
|
|||
|
||||
S3Object object = client.getObject(new GetObjectRequest(containerName,
|
||||
key));
|
||||
assertThat(object.getObjectMetadata().getContentLength()).isEqualTo(
|
||||
size);
|
||||
try (InputStream actual = object.getObjectContent();
|
||||
InputStream expected = byteSource.openStream()) {
|
||||
assertThat(actual).hasContentEqualTo(expected);
|
||||
|
|
Ładowanie…
Reference in New Issue