GraphBackedMetadataRepository implements MetadataRepository { @Override @GraphTransaction public List<String> getEntityList(String entityType) throws RepositoryException { if (LOG.isDebugEnabled()) { LOG.debug("Retrieving entity list for type={}", entityType); } AtlasGraphQuery query = getGraph().query().has(Constants.ENTITY_TYPE_PROPERTY_KEY, entityType); Iterator<AtlasVertex> results = query.vertices().iterator(); if (!results.hasNext()) { return Collections.emptyList(); } ArrayList<String> entityList = new ArrayList<>(); while (results.hasNext()) { AtlasVertex vertex = results.next(); entityList.add(GraphHelper.getGuid(vertex)); } return entityList; } @Inject  GraphBackedMetadataRepository(DeleteHandler deleteHandler, AtlasGraph atlasGraph); GraphToTypedInstanceMapper getGraphToInstanceMapper(); @Override String getTypeAttributeName(); @Override String getStateAttributeName(); @Override String getSuperTypeAttributeName(); String getIdAttributeName(); @Override String getVersionAttributeName(); @Override String getTraitLabel(IDataType<?> dataType, String traitName); @Override String getFieldNameInVertex(IDataType<?> dataType, AttributeInfo aInfo); String getFieldNameInVertex(IDataType<?> dataType, String attrName); @Override String getEdgeLabel(IDataType<?> dataType, AttributeInfo aInfo); @Override @GraphTransaction CreateUpdateEntitiesResult createEntities(ITypedReferenceableInstance... entities); @Override @GraphTransaction ITypedReferenceableInstance getEntityDefinition(String guid); @Override @GraphTransaction List<ITypedReferenceableInstance> getEntityDefinitions(String... guids); @Override @GraphTransaction ITypedReferenceableInstance getEntityDefinition(String entityType, String attribute, Object value); @Override @GraphTransaction List<String> getEntityList(String entityType); @Override @GraphTransaction List<String> getTraitNames(String guid); @Override @GraphTransaction void addTrait(List<String> entityGuids, ITypedStruct traitInstance); @Override @GraphTransaction void addTrait(String guid, ITypedStruct traitInstance); @Override @GraphTransaction void deleteTrait(String guid, String traitNameToBeDeleted); @Override @GraphTransaction CreateUpdateEntitiesResult updateEntities(ITypedReferenceableInstance... entitiesUpdated); @Override @GraphTransaction CreateUpdateEntitiesResult updatePartial(ITypedReferenceableInstance entity); @Override @GraphTransaction EntityResult deleteEntities(List<String> guids); AtlasGraph getGraph();  }
@Test(dependsOnMethods = "testSubmitEntity") public void testGetEntityList() throws Exception { List<String> entityList = repositoryService.getEntityList(TestUtils.DEPARTMENT_TYPE); System.out.println("entityList = " + entityList); Assert.assertNotNull(entityList); Assert.assertTrue(entityList.contains(guid)); }