use of org.dashbuilder.navigation.NavTree in project kie-wb-common by kiegroup.
the class DefaultWorkbenchFeaturesMenusHelperTest method buildMenusFromNavTreeTest.
@Test
public void buildMenusFromNavTreeTest() {
NavTree navTree = new NavTreeBuilder().group("g1", "g1", "g1", true).item("i1", "i1", "i1", true).endGroup().group("g2", "g2", "g2", true).item("i2", "i2", "i2", true).endGroup().group("g3", "g3", "g3", true).endGroup().build();
Menus menus = menusHelper.buildMenusFromNavTree(navTree).build();
List<MenuItem> menuItems = menus.getItems();
assertEquals(menuItems.size(), 2);
MenuGroup group1 = (MenuGroup) menuItems.get(0);
assertEquals(group1.getCaption(), "g1");
assertEquals(group1.getItems().size(), 1);
MenuItem item1 = group1.getItems().get(0);
assertEquals(item1.getCaption(), "i1");
MenuGroup group2 = (MenuGroup) menuItems.get(1);
assertEquals(group2.getCaption(), "g2");
assertEquals(group2.getItems().size(), 1);
MenuItem item2 = group2.getItems().get(0);
assertEquals(item2.getCaption(), "i2");
}
Aggregations