@Test public void forTextBodyShouldReturnStringContainingEmptyWhenEmptyString() { // Given String expected = "(Empty)"; // When String actual = testee.forTextBody(Optional.empty()); // Then assertThat(actual).isEqualTo(expected); }
@Test public void forTextBodyShouldReturnTruncatedStringWhenStringContainTagsAndIsLongerThan256Characters() { // Given String body = "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999" + "This is a <b>HTML</b> mail containing <u>underlined part</u>, <i>italic part</i>88888888889999999999" + "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999" + "000000000011111111112222222222333333333344444444445555555"; String expected = "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999" + "This is a <b>HTML</b> mail containing <u>underlined part</u>, <i>italic part</i>88888888889999999999" + "00000000001111111111222222222233333333334444444444555..."; // When String actual = testee.forTextBody(Optional.of(body)); // Then assertThat(actual).isEqualTo(expected); }