VisitsAtomView extends AbstractAtomFeedView { @Override protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { @SuppressWarnings("unchecked") List<Visit> visits = (List<Visit>) model.get("visits"); List<Entry> entries = new ArrayList<Entry>(visits.size()); for (Visit visit : visits) { Entry entry = new Entry(); String date = String.format("%1$tY-%1$tm-%1$td", visit.getDate()); entry.setId(String.format("tag:springsource.com,%s:%d", date, visit.getId())); entry.setTitle(String.format("%s visit on %s", visit.getPet().getName(), date)); entry.setUpdated(visit.getDate()); Content summary = new Content(); summary.setValue(visit.getDescription()); entry.setSummary(summary); entries.add(entry); } return entries; }    }
@Test public void buildFeedEntries() throws Exception { List<Entry> entries = visitView.buildFeedEntries(model, null, null); assertEquals("Invalid amount of entries", 2, entries.size()); }