@Test public void build_setAllValues_shouldCreateNewObjectAndSetAllFields() { Todo created = Todo.getBuilder(TITLE) .creationTime(TIMESTAMP) .description(DESCRIPTION) .id(ID) .modificationTime(TIMESTAMP) .build(); assertThatTodo(created) .hasDescription(DESCRIPTION) .hasId(ID) .hasTitle(TITLE) .wasCreatedAt(TIMESTAMP_STRING) .wasModifiedAt(TIMESTAMP_STRING); }
public static Builder getBuilder(String title) { return new Builder(title); }
Todo { public static Builder getBuilder(String title) { return new Builder(title); } }
Todo { public static Builder getBuilder(String title) { return new Builder(title); } private  Todo(Builder builder); }
Todo { public static Builder getBuilder(String title) { return new Builder(title); } private  Todo(Builder builder); static Builder getBuilder(String title); Long getId(); LocalDateTime getCreationTime(); String getDescription(); LocalDateTime getModificationTime(); String getTitle(); @Override String toString(); }
Todo { public static Builder getBuilder(String title) { return new Builder(title); } private  Todo(Builder builder); static Builder getBuilder(String title); Long getId(); LocalDateTime getCreationTime(); String getDescription(); LocalDateTime getModificationTime(); String getTitle(); @Override String toString();  }