Search in sources :

Example 1 with NewsBuilder

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);
}
Also used : NewsBuilder(org.mamute.builder.NewsBuilder) News(org.mamute.model.News) ReputationEventContext(org.mamute.model.ReputationEventContext) Test(org.junit.Test)

Example 2 with NewsBuilder

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());
}
Also used : NewsBuilder(org.mamute.builder.NewsBuilder) QuestionBuilder(org.mamute.builder.QuestionBuilder) News(org.mamute.model.News) Question(org.mamute.model.Question) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 NewsBuilder (org.mamute.builder.NewsBuilder)2 News (org.mamute.model.News)2 QuestionBuilder (org.mamute.builder.QuestionBuilder)1 Question (org.mamute.model.Question)1 ReputationEventContext (org.mamute.model.ReputationEventContext)1