CoursePublisher { List<String> getAllPublishNodeIds(CourseEditorTreeModel editorTreeModel) { final List<String> nodeIds = new ArrayList<String>(); addChildNodeIdRecursive(nodeIds, editorTreeModel.getRootNode()); return nodeIds; }  void publish(ICourse course, Identity publisherIdentity);  }
@Test public void getAllPublishNodeIds_onlyRootNode() { List<String> allNodeIds = coursePublisherTestObject.getAllPublishNodeIds(editorTreeModel); assertEquals("Wrong size of nodes", 1, allNodeIds.size()); allNodeIds.contains(rootNodeIdent); }
@Test public void getAllPublishNodeIds_twoChildNodesWithtwoChildNodes() { appendChildNodeWithSubChildNode(editorTreeModel.getRootNode(), firstChildNodeIdent); appendChildNodeWithSubChildNode(editorTreeModel.getRootNode(), secondChildNodeIdent); List<String> allNodeIds = coursePublisherTestObject.getAllPublishNodeIds(editorTreeModel); assertEquals("Wrong size of nodes", 7, allNodeIds.size()); assertTrue(allNodeIds.contains(rootNodeIdent)); assertTrue(allNodeIds.contains(firstChildNodeIdent)); assertTrue(allNodeIds.contains(secondChildNodeIdent)); assertTrue(allNodeIds.contains(firstChildNodeIdent + 1)); assertTrue(allNodeIds.contains(firstChildNodeIdent + 2)); assertTrue(allNodeIds.contains(secondChildNodeIdent + 1)); assertTrue(allNodeIds.contains(secondChildNodeIdent + 2)); }