TimelineCollector extends CompositeService { public void putEntitiesAsync(TimelineEntities entities, UserGroupInformation callerUgi) throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("putEntitiesAsync(entities=" + entities + ", callerUgi=" + callerUgi + ")"); } writeTimelineEntities(entities, callerUgi); } TimelineCollector(String name); abstract TimelineCollectorContext getTimelineEntityContext(); TimelineWriteResponse putEntities(TimelineEntities entities,
      UserGroupInformation callerUgi); TimelineWriteResponse putDomain(TimelineDomain domain,
      UserGroupInformation callerUgi); void putEntitiesAsync(TimelineEntities entities,
      UserGroupInformation callerUgi); static TimelineEntity aggregateEntities(
      TimelineEntities entities, String resultEntityId,
      String resultEntityType, boolean needsGroupIdInResult); static final String SEPARATOR; }
@Test public void testPutEntityAsync() throws IOException { TimelineWriter writer = mock(TimelineWriter.class); TimelineCollector collector = new TimelineCollectorForTest(writer); TimelineEntities entities = generateTestEntities(1, 1); collector.putEntitiesAsync( entities, UserGroupInformation.createRemoteUser("test-user")); verify(writer, times(1)).write(any(TimelineCollectorContext.class), any(TimelineEntities.class), any(UserGroupInformation.class)); verify(writer, never()).flush(); }