Event implements Parcelable, Comparable<Event> { public boolean hasUrl() { return getUrl() != null && !getUrl().trim().isEmpty(); } Event(); protected  Event(Parcel in); @Override void writeToParcel(Parcel dest, int flags); @Override int describeContents(); LocalDateTime getLocalStart(); @Nullable LocalDateTime getLocalEnd(); String getTitle(); OffsetDateTime getStart(); @Nullable OffsetDateTime getEnd(); String getLocation(); String getAddress(); boolean hasPreciseLocation(); boolean hasLocation(); String getDescription(); String getUrl(); boolean hasUrl(); String getAssociation(); String getIdentifier(); @Override int compareTo(Event o); @Override boolean equals(Object o); @Override int hashCode(); static final Creator<Event> CREATOR; }
@Test public void shouldNotHaveUrl_whenThereIsNoUrl() { Event event = Utils.generate(Event.class, "url"); assertFalse(event.hasUrl()); }
@Test public void shouldNotHaveUrl_whenThereIsEmptyUrl() { Event event = Utils.generate(Event.class, "url"); Utils.setField(event, "url", ""); assertFalse(event.hasUrl()); }
@Test public void shouldHaveUrl_whenThereIsUrl() { Event event = Utils.generate(Event.class); assertTrue(event.hasUrl()); }