@Test
public void testNextTuple() {

    chatConfig.granularityMins = 0;
    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));
    Map<String, Room> rooms = ImmutableMap.of("r1", new Room("r1", "room", null, DateTime.now(),
                                                             DateTime.now(), null, false, false,
                                                             null, null));
    when(dbDao.getLastMessagePullTime()).thenReturn(new DateTime(0, DateTimeZone.UTC));
    when(slackDao.getUsers()).thenReturn(users);
    when(slackDao.getRooms()).thenReturn(rooms);
    underTest.nextTuple();
    verify(slackDao).getUsers();
    verify(slackDao).getRooms();
    verify(dbDao).setLastMessagePullTime(any(DateTime.class));
    verify(dbDao).getLastMessagePullTime();
    verifyNoMoreInteractions(dbDao);
}