assertEquals(2, reader.getFeedItems().size());
Set<String> guids = new HashSet<String>();
{
// first item: New Event 123
FeedItem item = reader.getFeedItems().get(0);
assertEquals("New Event 123", item.getTitle());
assertEquals("This event is great, because it was loaded through RSS!", item.getDescription());
// construct expected URL
String expectedLink = getTestContext().getBaseUrl().toString() + newsUrl + "?generated_primary_key=";
assertTrue("Link '" + item.getLink() + "' does not begin with '" + expectedLink + "'", item.getLink().startsWith(expectedLink));
// need to construct the date
assertEquals(createUTCDate(2008, 05, 03, 9, 39, 21), item.getPubDate());
// and the GUID must be unique in this list
assertNotNull(item.getGuid());
assertFalse("List of GUIDs already contains '" + item.getGuid() + "': " + guids, guids.contains(item.getGuid()));
guids.add(item.getGuid());
}
{
// first item: New Event 123
FeedItem item = reader.getFeedItems().get(1);
assertEquals("New Event 124", item.getTitle());
assertEquals("This event is great, because it was also loaded through RSS!", item.getDescription());
// construct expected URL
String expectedLink = getTestContext().getBaseUrl().toString() + newsUrl + "?generated_primary_key=";
assertTrue("Link '" + item.getLink() + "' does not begin with '" + expectedLink + "'", item.getLink().startsWith(expectedLink));
// need to construct the date
assertEquals(createUTCDate(2008, 05, 03, 9, 39, 21), item.getPubDate());
// and the GUID must be unique in this list
assertNotNull(item.getGuid());
assertFalse("List of GUIDs already contains '" + item.getGuid() + "': " + guids, guids.contains(item.getGuid()));
guids.add(item.getGuid());
}
}