@Test
public void testPutEntityAsync() throws Exception {

  TimelineWriter writer = mock(TimelineWriter.class);
  TimelineCollector collector = new TimelineCollectorForTest(writer);
  collector.init(new Configuration());
  collector.start();
  TimelineEntities entities = generateTestEntities(1, 1);
  collector.putEntitiesAsync(
      entities, UserGroupInformation.createRemoteUser("test-user"));
  Thread.sleep(1000);
  verify(writer, times(1)).write(any(TimelineCollectorContext.class),
      any(TimelineEntities.class), any(UserGroupInformation.class));
  verify(writer, never()).flush();
  collector.stop();
}