@Test public void getRootFolderTest() { CMISService cmisService = CMISServiceImpl.getService(); FSObject root = cmisService.getRootFolder(); String expectedPath = "/"; assertEquals(root.getParent(), null); assertEquals(expectedPath, root.getPath()); }
@Test public void getFolderChildrenTest() throws Exception { CMISService cmisService = CMISServiceImpl.getService(); FSFolder parent = new FSFolder(); parent.setPath("/"); cmisService.deleteAllTree(parent); List<String> expectedNamesList = Arrays.asList( "My_Document-0-0", "My_Document-0-1", "My_Document-0-2", "My_Folder-0-0", "My_Folder-0-1"); for (String foldername : expectedNamesList) { cmisService.createFolder(parent, foldername); } List<FSObject> getObjectsList = cmisService.getChildren(parent); List<String> getNamesList = new ArrayList<String>(); for (FSObject i : getObjectsList) getNamesList.add(i.getName()); // the same elements in the same order assertThat(getNamesList, is(expectedNamesList)); }