@Test public void toStringShouldContainClassnameAndFields() throws Exception { Information information = new Information("Full edition", "Access to all themes", "€ 1.00"); String string = information.toString(); assertThat(string) .contains("Full edition") .contains("Access to all themes") .contains("€ 1.00") .contains(Information.class.getSimpleName()); }
@Override public String toString() { return "Information{" + "localName='" + localName + '\'' + ", localDescription='" + localDescription + '\'' + ", localPricing='" + localPricing + '\'' + '}'; }
Information { @Override public String toString() { return "Information{" + "localName='" + localName + '\'' + ", localDescription='" + localDescription + '\'' + ", localPricing='" + localPricing + '\'' + '}'; } }
Information { @Override public String toString() { return "Information{" + "localName='" + localName + '\'' + ", localDescription='" + localDescription + '\'' + ", localPricing='" + localPricing + '\'' + '}'; } Information(String localName, String localDescription, String localPricing); private  Information(Builder builder); }
Information { @Override public String toString() { return "Information{" + "localName='" + localName + '\'' + ", localDescription='" + localDescription + '\'' + ", localPricing='" + localPricing + '\'' + '}'; } Information(String localName, String localDescription, String localPricing); private  Information(Builder builder); static Builder newBuilder(); @Deprecated @Nullable Integer getPriceInCents(); @Nullable FreeTrialPeriod getFreeTrialPeriod(); @Nullable Double getPriceAsDouble(); String getPriceCurrencyCode(); String getLocalName(); String getLocalDescription(); String getLocalPricing(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Information { @Override public String toString() { return "Information{" + "localName='" + localName + '\'' + ", localDescription='" + localDescription + '\'' + ", localPricing='" + localPricing + '\'' + '}'; } Information(String localName, String localDescription, String localPricing); private  Information(Builder builder); static Builder newBuilder(); @Deprecated @Nullable Integer getPriceInCents(); @Nullable FreeTrialPeriod getFreeTrialPeriod(); @Nullable Double getPriceAsDouble(); String getPriceCurrencyCode(); String getLocalName(); String getLocalDescription(); String getLocalPricing(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Information UNAVAILABLE; }