@Test public void testFetchLatest() { Date from; from = new GregorianCalendar(2011, 7, 22, 7, 0, 0).getTime(); Assert.assertEquals(6, subject.fetch(channel, from).size()); from = new GregorianCalendar(2011, 7, 22, 4, 0, 0).getTime(); Assert.assertEquals(18, subject.fetch(channel, from).size()); }
@Test public void testMapping() throws Exception { List<Article> articleList; Article article; articleList = subject.fetch(channel, new Date(0)); Assert.assertEquals(false, articleList.isEmpty()); article = articleList.get(0); Assert.assertEquals("title", article.getTitle()); Assert.assertEquals("description", article.getDescription()); Assert.assertEquals("http://link", article.getLink()); Assert.assertEquals( new GregorianCalendar(2011, 7, 22, 8, 48, 0).getTime(), article.getPublished()); Assert.assertEquals(channel.getUrl().toURI().toURL().toExternalForm(), article.getSource()); }