@Test
public void testBackfillRooms() {

    stormConf.put(ConfigurationConstants.CHATALYTICS_CONFIG.txt, YamlUtils.writeYaml(config));
    IChatAlyticsDAO dbDao = mock(IChatAlyticsDAO.class);
    IChatApiDAO slackDao = mock(IChatApiDAO.class);
    underTest.open(chatConfig, slackDao, dbDao, context, collector);
    Map<String, User> users = ImmutableMap.of("u1", new User("u1", "email", false, false, false,
                                                             "name", "mention_name", null,
                                                             DateTime.now(), DateTime.now(),
                                                             null, null, null, null));
    Room room = new Room("r1", "room", null, DateTime.now(), DateTime.now(), null, false, false,
                         null, null);
    Map<String, Room> rooms = ImmutableMap.of("r1", room);
    Interval interval = new Interval(DateTime.now().minusDays(1), DateTime.now());
    Message message = new Message(DateTime.now(), "from", "u1", "test message", "r1",
                                  MessageType.MESSAGE);
    List<Message> messages = Lists.newArrayList(message);
    when(slackDao.getMessages(interval.getStart(), interval.getEnd(), room)).thenReturn(messages);
    underTest.backfillRooms(users, rooms, interval);
    verify(slackDao).getMessages(interval.getStart(), interval.getEnd(), room);
    verifyNoMoreInteractions(slackDao);
    verify(collector).emit(any(Values.class));
    verifyNoMoreInteractions(collector);
}