Blob { public static Builder builder() { return new Builder(); } @VisibleForTesting  Blob(BlobId blobId, InputStreamSupplier payload, ContentType contentType, long size); static Builder builder(); BlobId getBlobId(); InputStream getStream(); long getSize(); ContentType getContentType(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString();  }
@Test void buildShouldConstructValidBlob() { assertThat( Blob.builder() .id(ID) .contentType(CONTENT_TYPE) .payload(PAYLOAD) .size(LENGTH) .build()) .isEqualTo( new Blob(ID, PAYLOAD, CONTENT_TYPE, LENGTH)); }
@Test void buildShouldThrowOnMissingBlobId() { assertThatThrownBy(() -> Blob.builder() .contentType(CONTENT_TYPE) .payload(PAYLOAD) .build()) .isInstanceOf(IllegalStateException.class); }
@Test void buildShouldThrowOnMissingContentType() { assertThatThrownBy(() -> Blob.builder() .id(ID) .payload(PAYLOAD) .build()) .isInstanceOf(IllegalStateException.class); }
@Test void buildShouldThrowOnMissingPayload() { assertThatThrownBy(() -> Blob.builder() .id(ID) .contentType(CONTENT_TYPE) .build()) .isInstanceOf(IllegalStateException.class); }