@Test void fromShouldThrowWhenValueLengthIsLongerThanMaximum256() { String errorMessageRegex = "the preview value '.*' has length longer than 256"; assertThatThrownBy(() -> Preview.from(Strings.repeat("a", 257))) .isInstanceOf(IllegalArgumentException.class) .hasMessageMatching(errorMessageRegex); }
public static Preview from(String value) { return new Preview(value); }
Preview { public static Preview from(String value) { return new Preview(value); } }
Preview { public static Preview from(String value) { return new Preview(value); } @VisibleForTesting  Preview(String value); }
Preview { public static Preview from(String value) { return new Preview(value); } @VisibleForTesting  Preview(String value); static Preview from(String value); static Preview compute(String textBody); String getValue(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); }
Preview { public static Preview from(String value) { return new Preview(value); } @VisibleForTesting  Preview(String value); static Preview from(String value); static Preview compute(String textBody); String getValue(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); static final Preview EMPTY; }