use of org.opennms.features.topology.app.internal.TestOperationContext in project opennms by OpenNMS.
the class MenuBuilderTest method createContextMenuTest.
@Test
public void createContextMenuTest() {
MenuBuilder builder = new MenuBuilder();
builder.addMenuItem(createEmptyMenuItem("Test"), "Layout");
MenuBar menubar = builder.build(Lists.newArrayList(), new TestOperationContext(null));
TopologyContextMenu contextMenu = new TopologyContextMenu(menubar);
List<ContextMenuState.ContextMenuItemState> contextMenuItems = contextMenu.getItems();
assertEquals(1, contextMenuItems.size());
assertEquals("Layout", contextMenuItems.get(0).caption);
List<ContextMenuState.ContextMenuItemState> subMenuItems = contextMenuItems.get(0).getChildren();
assertEquals(1, subMenuItems.size());
ContextMenuState.ContextMenuItemState submenuItem = subMenuItems.get(0);
assertEquals("Test", submenuItem.caption);
}
Aggregations