@Test public void buildShouldWorkWithAllFieldsSet() { Number attachmentSize = Number.fromLong(123); Optional<Number> attachmentWidth = Optional.of(Number.fromLong(456L)); Optional<Number> attachmentHeight = Optional.of(Number.fromLong(789L)); Attachment expected = new Attachment(BlobId.of("blobId"), ContentType.of("type"), Optional.of("name"), attachmentSize, Optional.of("cid"), true, attachmentWidth, attachmentHeight); Attachment tested = Attachment.builder() .blobId(BlobId.of("blobId")) .type("type") .name("name") .size(123) .cid("cid") .isInline(true) .width(456) .height(789) .build(); assertThat(tested).isEqualToComparingFieldByField(expected); }
public static Builder builder() { return new Builder(); }
Attachment { public static Builder builder() { return new Builder(); } }
Attachment { public static Builder builder() { return new Builder(); } @VisibleForTesting  Attachment(BlobId blobId, ContentType type, Optional<String> name, Number size, Optional<String> cid, boolean isInline, Optional<Number> width, Optional<Number> height); }
Attachment { public static Builder builder() { return new Builder(); } @VisibleForTesting  Attachment(BlobId blobId, ContentType type, Optional<String> name, Number size, Optional<String> cid, boolean isInline, Optional<Number> width, Optional<Number> height); static Builder builder(); BlobId getBlobId(); ContentType getType(); Optional<String> getName(); Number getSize(); Optional<String> getCid(); boolean isIsInline(); Boolean isInlinedWithCid(); Optional<Number> getWidth(); Optional<Number> getHeight(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
Attachment { public static Builder builder() { return new Builder(); } @VisibleForTesting  Attachment(BlobId blobId, ContentType type, Optional<String> name, Number size, Optional<String> cid, boolean isInline, Optional<Number> width, Optional<Number> height); static Builder builder(); BlobId getBlobId(); ContentType getType(); Optional<String> getName(); Number getSize(); Optional<String> getCid(); boolean isIsInline(); Boolean isInlinedWithCid(); Optional<Number> getWidth(); Optional<Number> getHeight(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }