@Test public void self_reference_is_forbidden() { Search adSearch = createSearchWithName("ad"); createDocumentReference(adSearch, adSearch, "ad_ref"); DocumentGraphValidator validator = new DocumentGraphValidator(); exceptionRule.expect(DocumentGraphValidator.DocumentGraphException.class); exceptionRule.expectMessage("Document dependency cycle detected: ad->ad."); validator.validateDocumentGraph(documentListOf(adSearch)); }
public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } } }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }  }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }  void validateDocumentGraph(List<SDDocumentType> documents); }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }  void validateDocumentGraph(List<SDDocumentType> documents);  }