### Question:
ContentEditorText { public String getTextForImage(String link) { return getTextForImage(null, link); }  String getTextForImage(String link); String getTextForImage(String name, String link);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void shouldThrowException_whenLinkIsNull() throws Exception { contentText.getTextForImage(null); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowException_whenLinkIsEmpty() throws Exception { contentText.getTextForImage(""); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowException_whenLinkNotStartWithHttp() throws Exception { contentText.getTextForImage("i.imgur.com/5iFkXQl.jpg"); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowException_whenNameNullAndLinkIsNull() throws Exception { contentText.getTextForImage(null, null); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowException_whenNameNullAndLinkIsEmpty() throws Exception { contentText.getTextForImage(null, ""); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowException_whenNameEmptyAndLinkIsNull() throws Exception { contentText.getTextForImage("", null); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowException_whenNameEmptyAndLinkIsEmpty() throws Exception { contentText.getTextForImage("", ""); }
@Test public void shouldBuildText_whenLinkIsOk() { String text = contentText.getTextForImage(LINK); assertThat(text).isNotEmpty().isEqualToIgnoringCase(RESULT); }
@Test public void shouldBuildText_whenNameIsOkAndLinkIsOk() { String text = contentText.getTextForImage(NAME, LINK); assertThat(text).isNotEmpty().isEqualToIgnoringCase(RESULT_WITH_NAME); }