EntityDAOImpl extends AbstractIdleService implements IEntityDAO { @Override public List<ChatEntity> getAllMentionsForEntity(String entity, Interval interval, List<String> roomNames, List<String> usernames) { return occurrenceStatsDAO.getAllMentionsForValue(entity, interval, roomNames, usernames); } EntityDAOImpl(EntityManagerFactory entityManagerFactory); @Override void persistEntity(ChatEntity entity); @Override ChatEntity getEntity(ChatEntity entity); @Override List<ChatEntity> getAllMentionsForEntity(String entity,
                                                    Interval interval,
                                                    List<String> roomNames,
                                                    List<String> usernames); @Override List<ChatEntity> getAllMentions(Interval interval,
                                           List<String> roomNames,
                                           List<String> usernames,
                                           boolean withBots); @Override int getTotalMentionsForEntity(String entity,
                                         Interval interval,
                                         List<String> roomNames,
                                         List<String> usernames,
                                         boolean withBots); @Override Map<String, Long> getTopEntities(Interval interval,
                                            List<String> roomNames,
                                            List<String> usernames,
                                            int resultSize,
                                            boolean withBots); @Override LabeledDenseMatrix<String> getRoomSimilaritiesByEntity(Interval interval,
                                                                  boolean withBots); @Override LabeledDenseMatrix<String> getUserSimilaritiesByEntity(Interval interval,
                                                                  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 testGetAllMentionsForEntity() { Interval timeInterval = new Interval(mentionDate, mentionDate.plusHours(3)); List<ChatEntity> result = underTest.getAllMentionsForEntity("e1", timeInterval, ImmutableList.of(), ImmutableList.of()); assertEquals(3, result.size()); result = underTest.getAllMentionsForEntity("e1", timeInterval, ImmutableList.of("room1"), ImmutableList.of()); assertEquals(2, result.size()); result = underTest.getAllMentionsForEntity("e1", timeInterval, ImmutableList.of("room1"), ImmutableList.of("giannis")); assertEquals(1, result.size()); }