use of org.hamcrest.core.SubstringMatcher in project rssriver by dadoonet.
the class RssToJsonTest method shouldNotHaveRawContent.
@Test
public void shouldNotHaveRawContent() throws Exception {
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(getClass().getResource("/dcrainmaker/rss.xml")));
assertThat(feed.getEntries().size(), greaterThan(0));
for (Object o : feed.getEntries()) {
SyndEntryImpl message = (SyndEntryImpl) o;
XContentBuilder xcb = toJson(message, null, null, false);
assertThat(xcb, notNullValue());
assertThat(xcb.string(), new SubstringMatcher("<p>") {
@Override
protected boolean evalSubstringOf(String s) {
return s.indexOf(substring) < 0;
}
@Override
protected String relationship() {
return "not containing";
}
});
logger.info(xcb.string());
}
}
Aggregations