@Test public void visit_module_with_depth_PROJECT_does_not_call_visit_module_nor_visitAny() { Component component = component(MODULE, 1); projectCrawler.visit(component); assertThat(projectVisitor.callsRecords).isEmpty(); }
@Test public void visit_directory_with_depth_PROJECT_does_not_call_visit_directory_nor_visitAny() { Component component = component(DIRECTORY, 1); projectCrawler.visit(component); assertThat(projectVisitor.callsRecords).isEmpty(); }
@Test public void visit_directory_with_depth_MODULE_does_not_call_visit_directory_not_visit_any() { Component component = component(DIRECTORY, 1); moduleCrawler.visit(component); assertThat(moduleVisitor.callsRecords).isEmpty(); }
@Test public void visit_file_with_depth_MODULE_does_not_call_visit_file_nor_visit_any() { Component component = component(FILE, 1); moduleCrawler.visit(component); assertThat(moduleVisitor.callsRecords).isEmpty(); }
@Test public void visit_viewView_with_depth_SUBVIEW_does_not_call_visit_viewView_nor_visitAny() { Component component = component(PROJECT_VIEW, 1); subViewCrawler.visit(component); assertThat(subViewVisitor.callsRecords).isEmpty(); }
@Test public void visit_file_with_depth_DIRECTORY_does_not_call_visit_file_nor_visitAny() { Component component = component(FILE, 1); directoryCrawler.visit(component); assertThat(directoryVisitor.callsRecords).isEmpty(); }
@Test public void visit_subView_with_depth_SUBVIEW_calls_visit_subView() { Component component = component(SUBVIEW, 1); subViewCrawler.visit(component); assertThat(subViewVisitor.callsRecords) .containsExactly( viewsCallRecord("visitAny", component), viewsCallRecord("visitSubView", component)); }
@Test public void visit_project_with_depth_FILE_calls_visit_project() { Component component = component(PROJECT, 1); fileCrawler.visit(component); assertThat(fileVisitor.callsRecords) .containsExactly( reportCallRecord("visitAny", component), reportCallRecord("visitProject", component)); }
@Test public void visit_module_with_depth_FILE_calls_visit_module() { Component component = component(MODULE, 1); fileCrawler.visit(component); assertThat(fileVisitor.callsRecords) .containsExactly( reportCallRecord("visitAny", component), reportCallRecord("visitModule", component)); }
@Test public void visit_view_with_depth_PROJECT_VIEW_calls_visit_view() { Component component = component(VIEW, 1); projectViewCrawler.visit(component); assertThat(projectViewVisitor.callsRecords) .containsExactly( viewsCallRecord("visitAny", component), viewsCallRecord("visitView", component)); }
@Test public void verify_visit_call_when_visit_tree_with_depth_VIEW() { viewCrawler.visit(COMPONENT_TREE); assertThat(viewVisitor.callsRecords) .containsExactly( viewsCallRecord("visitAny", COMPONENT_TREE), viewsCallRecord("visitView", COMPONENT_TREE)); }
@Test public void visit_directory_with_depth_FILE_calls_visit_directory() { Component component = component(DIRECTORY, 1); fileCrawler.visit(component); assertThat(fileVisitor.callsRecords) .containsExactly( reportCallRecord("visitAny", component), reportCallRecord("visitDirectory", component)); }
@Test public void visit_module_with_depth_DIRECTORY_calls_visit_module() { Component component = component(MODULE, 1); directoryCrawler.visit(component); assertThat(directoryVisitor.callsRecords) .containsExactly( reportCallRecord("visitAny", component), reportCallRecord("visitModule", component)); }
@Test public void verify_visit_call_when_visit_tree_with_depth_PROJECT() { projectCrawler.visit(COMPONENT_TREE); assertThat(projectVisitor.callsRecords) .containsExactly( reportCallRecord("visitAny", COMPONENT_TREE), reportCallRecord("visitProject", COMPONENT_TREE)); }
@Test public void verify_visit_call_when_visit_tree_with_depth_MODULE() { moduleCrawler.visit(COMPONENT_TREE); assertThat(moduleVisitor.callsRecords) .containsExactly( reportCallRecord("visitAny", COMPONENT_TREE), reportCallRecord("visitProject", COMPONENT_TREE), reportCallRecord("visitAny", MODULE_2), reportCallRecord("visitModule", MODULE_2), reportCallRecord("visitAny", MODULE_3), reportCallRecord("visitModule", MODULE_3)); }
@Test public void verify_visit_call_when_visit_tree_with_depth_DIRECTORY() { directoryCrawler.visit(COMPONENT_TREE); assertThat(directoryVisitor.callsRecords) .containsExactly( reportCallRecord("visitAny", COMPONENT_TREE), reportCallRecord("visitProject", COMPONENT_TREE), reportCallRecord("visitAny", MODULE_2), reportCallRecord("visitModule", MODULE_2), reportCallRecord("visitAny", MODULE_3), reportCallRecord("visitModule", MODULE_3), reportCallRecord("visitAny", DIRECTORY_4), reportCallRecord("visitDirectory", DIRECTORY_4)); }
@Test public void verify_visit_call_when_visit_tree_with_depth_PROJECT_VIEW() { projectViewCrawler.visit(COMPONENT_TREE); assertThat(projectViewVisitor.callsRecords) .containsExactly( viewsCallRecord("visitAny", PROJECT_VIEW_5), viewsCallRecord("visitProjectView", PROJECT_VIEW_5), viewsCallRecord("visitAny", PROJECT_VIEW_6), viewsCallRecord("visitProjectView", PROJECT_VIEW_6), viewsCallRecord("visitAny", SUBVIEW_4), viewsCallRecord("visitSubView", SUBVIEW_4), viewsCallRecord("visitAny", SUBVIEW_3), viewsCallRecord("visitSubView", SUBVIEW_3), viewsCallRecord("visitAny", SUBVIEW_2), viewsCallRecord("visitSubView", SUBVIEW_2), viewsCallRecord("visitAny", COMPONENT_TREE), viewsCallRecord("visitView", COMPONENT_TREE)); }
@Test(expected = NullPointerException.class) public void visit_null_Component_throws_NPE() { projectViewCrawler.visit(null); }