MailQueueItemDTO { public static Builder builder() { return new Builder(); } MailQueueItemDTO(String name, String sender, List<String> recipients, Optional<ZonedDateTime> nextDelivery); static Builder builder(); static MailQueueItemDTO from(ManageableMailQueue.MailQueueItemView mailQueueItemView); String getName(); String getSender(); List<String> getRecipients(); Optional<ZonedDateTime> getNextDelivery();  }
@Test public void buildShouldThrowWhenNameIsNull() { assertThatThrownBy(() -> MailQueueItemDTO.builder().build()) .isInstanceOf(IllegalArgumentException.class); }
@Test public void buildShouldThrowWhenNameIsEmpty() { assertThatThrownBy(() -> MailQueueItemDTO.builder().name("").build()) .isInstanceOf(IllegalArgumentException.class); }