use of org.mamute.builder.NewsBuilder in project mamute by caelum.
the class VoteDAOTest method should_find_news_from_votable.
@Test
public void should_find_news_from_votable() throws Exception {
News news = new NewsBuilder().build();
ReputationEventContext context = votes.contextOf(news);
assertEquals(news, context);
}
use of org.mamute.builder.NewsBuilder in project mamute by caelum.
the class PostViewCounterTest method should_increase_count_only_the_news_counter.
@Test
public void should_increase_count_only_the_news_counter() {
Question question = new QuestionBuilder().withId(1l).build();
News news = new NewsBuilder().withId(1l).build();
questionViewCounter.ping(question);
mockQuestionVisited(question);
questionViewCounter.ping(news);
assertEquals(1l, question.getViews());
assertEquals(1l, news.getViews());
}
Aggregations