@Test public void testPutDomain() throws IOException {

  TimelineWriter writer = mock(TimelineWriter.class);
  TimelineCollector collector = new TimelineCollectorForTest(writer);
  TimelineDomain domain =
      generateDomain("id", "desc", "owner", "reader1,reader2", "writer", 0L,
          1L);
  collector.putDomain(domain, UserGroupInformation.createRemoteUser("owner"));
  verify(writer, times(1))
      .write(any(TimelineCollectorContext.class), any(TimelineDomain.class));
  verify(writer, times(1)).flush();
}