@Test public final void parseInformationTest() { final LinkInformation link = new LinkInformation(); final String html = "<html></html>"; context.checking(new Expectations() { { oneOf(descriptionParser).parseInformation(html, link, TEST_ACCOUNT); oneOf(imageParser).parseInformation(html, link, TEST_ACCOUNT); oneOf(titleParser).parseInformation(html, link, TEST_ACCOUNT); } }); sut.parseLinkInformation(html, link, TEST_ACCOUNT); context.assertIsSatisfied(); }
public void parseLinkInformation(final String htmlString, final LinkInformation link, final String inAccountId) { titleParser.parseInformation(htmlString, link, inAccountId); descriptionParser.parseInformation(htmlString, link, inAccountId); if(!disableThumbnails) { imageParser.parseInformation(htmlString, link, inAccountId); } }
HtmlLinkParser { public void parseLinkInformation(final String htmlString, final LinkInformation link, final String inAccountId) { titleParser.parseInformation(htmlString, link, inAccountId); descriptionParser.parseInformation(htmlString, link, inAccountId); if(!disableThumbnails) { imageParser.parseInformation(htmlString, link, inAccountId); } } }
HtmlLinkParser { public void parseLinkInformation(final String htmlString, final LinkInformation link, final String inAccountId) { titleParser.parseInformation(htmlString, link, inAccountId); descriptionParser.parseInformation(htmlString, link, inAccountId); if(!disableThumbnails) { imageParser.parseInformation(htmlString, link, inAccountId); } }  }
HtmlLinkParser { public void parseLinkInformation(final String htmlString, final LinkInformation link, final String inAccountId) { titleParser.parseInformation(htmlString, link, inAccountId); descriptionParser.parseInformation(htmlString, link, inAccountId); if(!disableThumbnails) { imageParser.parseInformation(htmlString, link, inAccountId); } }  void parseLinkInformation(final String htmlString, final LinkInformation link, final String inAccountId); void setImageParser(final HtmlLinkInformationParserStrategy inImageParser); void setDescriptionParser(final HtmlLinkInformationParserStrategy inDescriptionParser); void setTitleParser(final HtmlLinkInformationParserStrategy inTitleParser); void setRegex(final String inRegex); String getRegex(); void setDisableThumbnails(final boolean inDisableThumbnails); }
HtmlLinkParser { public void parseLinkInformation(final String htmlString, final LinkInformation link, final String inAccountId) { titleParser.parseInformation(htmlString, link, inAccountId); descriptionParser.parseInformation(htmlString, link, inAccountId); if(!disableThumbnails) { imageParser.parseInformation(htmlString, link, inAccountId); } }  void parseLinkInformation(final String htmlString, final LinkInformation link, final String inAccountId); void setImageParser(final HtmlLinkInformationParserStrategy inImageParser); void setDescriptionParser(final HtmlLinkInformationParserStrategy inDescriptionParser); void setTitleParser(final HtmlLinkInformationParserStrategy inTitleParser); void setRegex(final String inRegex); String getRegex(); void setDisableThumbnails(final boolean inDisableThumbnails);  }