public void containsBlogPostFields() throws Exception {
Post post = PostBuilder.post().category(PostCategory.ENGINEERING).isBroadcast().build();
postRepository.save(post);
ResultActions resultActions = mockMvc.perform(get("/blog.atom"));
MvcResult mvcResult = resultActions
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith("application/atom+xml"))
.andReturn();
assertThat(mvcResult.getResponse().getCharacterEncoding(), equalTo("utf-8"));
String atomFeed = mvcResult.getResponse().getContentAsString();
assertThat(atomFeed, containsString(post.getTitle()));
assertThat(atomFeed, containsString(post.getRenderedContent()));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setTimeZone(DateFactory.DEFAULT_TIME_ZONE);