@Test void testGetEntityTypesDependentOnCircular() { when(entity0.getId()).thenReturn("0"); when(entity0.getIndexingDepth()).thenReturn(1); List<EntityType> entityTypes = ImmutableList.of(entity0); addReferences(entity0, ImmutableList.of(entity0)); IndexDependencyModel dependencyModel = new IndexDependencyModel(entityTypes); Set<String> dependencies = dependencyModel.getEntityTypesDependentOn("0").collect(toSet()); assertEquals(of("0"), dependencies); }
Stream<String> getEntityTypesDependentOn(String entityTypeId) { return genericDependencyResolver .getAllDependants( entityTypeId, id -> entityTypes.get(id).getIndexingDepth(), this::getReferencingEntities) .stream(); }
IndexDependencyModel { Stream<String> getEntityTypesDependentOn(String entityTypeId) { return genericDependencyResolver .getAllDependants( entityTypeId, id -> entityTypes.get(id).getIndexingDepth(), this::getReferencingEntities) .stream(); } }
IndexDependencyModel { Stream<String> getEntityTypesDependentOn(String entityTypeId) { return genericDependencyResolver .getAllDependants( entityTypeId, id -> entityTypes.get(id).getIndexingDepth(), this::getReferencingEntities) .stream(); } IndexDependencyModel(List<EntityType> entityTypes); }
IndexDependencyModel { Stream<String> getEntityTypesDependentOn(String entityTypeId) { return genericDependencyResolver .getAllDependants( entityTypeId, id -> entityTypes.get(id).getIndexingDepth(), this::getReferencingEntities) .stream(); } IndexDependencyModel(List<EntityType> entityTypes);  }
IndexDependencyModel { Stream<String> getEntityTypesDependentOn(String entityTypeId) { return genericDependencyResolver .getAllDependants( entityTypeId, id -> entityTypes.get(id).getIndexingDepth(), this::getReferencingEntities) .stream(); } IndexDependencyModel(List<EntityType> entityTypes);   }