MessageSummaryDAOImpl extends AbstractIdleService implements IMessageSummaryDAO { @Override public MessageSummary getMessageSummary(MessageSummary messageSummary) { return occurrenceStatsDAO.getValue(messageSummary); } MessageSummaryDAOImpl(EntityManagerFactory emf); @Override void persistMessageSummary(MessageSummary messageSummary); @Override MessageSummary getMessageSummary(MessageSummary messageSummary); @Override List<MessageSummary> getAllMessageSummariesForType(MessageType type,
                                                              Interval interval,
                                                              List<String> roomNames,
                                                              List<String> usernames); @Override List<MessageSummary> getAllMessageSummaries(Interval interval,
                                                       List<String> roomNames,
                                                       List<String> usernames,
                                                       boolean withBots); @Override int getTotalMessageSummaries(Interval interval, List<String> roomNames,
                                        List<String> usernames, boolean withBots); @Override int getTotalMessageSummariesForType(MessageType type,
                                               Interval interval,
                                               List<String> roomNames,
                                               List<String> usernames,
                                               boolean withBots); @Override Map<String, Double> getActiveUsersByMethod(Interval interval,
                                                      ActiveMethod method,
                                                      int resultSize,
                                                      boolean withBots); @Override Map<String, Double> getActiveRoomsByMethod(Interval interval,
                                                      ActiveMethod method,
                                                      int resultSize,
                                                      boolean withBots);  }
@Test public void testGetMentionSummary() { MessageSummary msgSummary = new MessageSummary("user1", "room1", mentionDate, MessageType.MESSAGE, 0, false); MessageSummary result = underTest.getMessageSummary(msgSummary); assertNotNull(result); assertEquals(msgSummary.getMentionTime(), result.getMentionTime()); assertEquals(1, result.getOccurrences()); assertEquals(msgSummary.getRoomName(), result.getRoomName()); assertEquals(msgSummary.getUsername(), result.getUsername()); assertEquals(msgSummary.getValue(), result.getValue()); }