### Question:
PostListRssViewer extends AbstractRssFeedView { @Override protected void buildFeedMetadata(Map<String, Object> model, Channel feed, HttpServletRequest request) { String title = (String)model.get("feedTitle"); if (title == null) { title = DEFAULT_FEED_TITLE; } String description = (String)model.get("feedDescription"); if (description == null) { description = DEFAULT_FEED_DESCRIPTION; } String link = buildURL(request); String suffix = (String)model.get("urlSuffix"); if (suffix != null) { link += suffix; } feed.setTitle(title); feed.setDescription(description); feed.setLink(link); super.buildFeedMetadata(model, feed, request); }   static final String DEFAULT_FEED_TITLE; static final String DEFAULT_FEED_DESCRIPTION; }### Answer:
@Test public void buildFeedMetadataShouldUseDefaultValuesWhenThereIsNoBranchInModel() { Map<String, Object> model = new HashMap<>(); Channel channel = new Channel(); postListRssViewer.buildFeedMetadata(model, channel, getMockRequest()); assertEquals(channel.getTitle(), PostListRssViewer.DEFAULT_FEED_TITLE); assertEquals(channel.getDescription(), PostListRssViewer.DEFAULT_FEED_DESCRIPTION); assertEquals(channel.getLink(), "http: }
@Test public void buildFeedMetadataShouldUseBranchInfoWhenThereIsBranchInModel() { Map<String, Object> model = new HashMap<>(); model.put("feedTitle", "my branch"); model.put("feedDescription", "my description"); model.put("urlSuffix", "/branches/42"); Channel channel = new Channel(); postListRssViewer.buildFeedMetadata(model, channel, getMockRequest()); assertEquals(channel.getTitle(), "my branch"); assertEquals(channel.getDescription(), "my description"); assertEquals(channel.getLink(), "http: }