TimelineDataManager extends AbstractService { public TimelineEntity getEntity( String entityType, String entityId, EnumSet<Field> fields, UserGroupInformation callerUGI) throws YarnException, IOException { TimelineEntity entity = null; entity = store.getEntity(entityId, entityType, fields); if (entity != null) { addDefaultDomainIdIfAbsent(entity); if (!timelineACLsManager.checkAccess( callerUGI, ApplicationAccessType.VIEW_APP, entity)) { entity = null; } } return entity; } TimelineDataManager(TimelineStore store,
      TimelineACLsManager timelineACLsManager); TimelineEntities getEntities(
      String entityType,
      NameValuePair primaryFilter,
      Collection<NameValuePair> secondaryFilter,
      Long windowStart,
      Long windowEnd,
      String fromId,
      Long fromTs,
      Long limit,
      EnumSet<Field> fields,
      UserGroupInformation callerUGI); TimelineEntity getEntity(
      String entityType,
      String entityId,
      EnumSet<Field> fields,
      UserGroupInformation callerUGI); TimelineEvents getEvents(
      String entityType,
      SortedSet<String> entityIds,
      SortedSet<String> eventTypes,
      Long windowStart,
      Long windowEnd,
      Long limit,
      UserGroupInformation callerUGI); TimelinePutResponse postEntities(
      TimelineEntities entities,
      UserGroupInformation callerUGI); void putDomain(TimelineDomain domain,
      UserGroupInformation callerUGI); TimelineDomain getDomain(String domainId,
      UserGroupInformation callerUGI); TimelineDomains getDomains(String owner,
      UserGroupInformation callerUGI); @VisibleForTesting
  static final String DEFAULT_DOMAIN_ID; }
@Test public void testGetOldEntityWithOutDomainId() throws Exception { TimelineEntity entity = dataManaer.getEntity( "OLD_ENTITY_TYPE_1", "OLD_ENTITY_ID_1", null, UserGroupInformation.getCurrentUser()); Assert.assertNotNull(entity); Assert.assertEquals("OLD_ENTITY_ID_1", entity.getEntityId()); Assert.assertEquals("OLD_ENTITY_TYPE_1", entity.getEntityType()); Assert.assertEquals( TimelineDataManager.DEFAULT_DOMAIN_ID, entity.getDomainId()); }