Assert expected content length

This makes some errors more obvious than comparing the content data.
pull/101/head
Andrew Gaul 2015-12-02 21:55:38 +08:00
rodzic 4a4d2f7e6a
commit 01c43c9f1b
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -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);