VisitsAtomView extends AbstractAtomFeedView { @Override protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) { feed.setId("tag:springsource.com"); feed.setTitle("Pet Clinic Visits"); @SuppressWarnings("unchecked") List<Visit> visits = (List<Visit>) model.get("visits"); for (Visit visit : visits) { Date date = visit.getDate(); if (feed.getUpdated() == null || date.compareTo(feed.getUpdated()) > 0) { feed.setUpdated(date); } } }    }
@Test public void buildFeedMetadata() { visitView.buildFeedMetadata(model, feed, null); assertNotNull("No id set", feed.getId()); assertNotNull("No title set", feed.getTitle()); assertEquals("Invalid update set", new Date(2009, 0, 2), feed.getUpdated()); }