* shouldn't happen.
*/
@Test
public final void imgDownloadHostPathTest() throws IOException
{
final LinkInformation link = new LinkInformation();
link.setUrl("http://www.someurl.com");
final String html = "<html><body>" + "<img src=\"/someimg1.png\" /></body></html>";
context.checking(new Expectations()
{
{
oneOf(urlUtils).getImgHeight("http://www.someurl.com/someimg1.png", TEST_ACCOUNT);
will(returnValue(BasicLinkImageParser.MIN_IMG_SIZE + 1));
oneOf(urlUtils).getImgWidth("http://www.someurl.com/someimg1.png", TEST_ACCOUNT);
will(returnValue(BasicLinkImageParser.MIN_IMG_SIZE + 1));
oneOf(urlUtils).getProtocol("http://www.someurl.com");
will(returnValue("http"));
oneOf(urlUtils).getHost("http://www.someurl.com");
will(returnValue("www.someurl.com"));
}
});
sut.parseInformation(html, link, TEST_ACCOUNT);
Assert.assertTrue(link.getImageUrls().contains("http://www.someurl.com/someimg1.png"));
context.assertIsSatisfied();
}