use of org.uberfire.workbench.model.menu.impl.BaseMenuCustom in project kie-wb-common by kiegroup.
the class ProjectEditorMenuSessionItemsTest method testIsEnabledWithRegisteredMenuItem.
@Test
public void testIsEnabledWithRegisteredMenuItem() {
final MenuItem menuItem = new BaseMenuCustom<String>() {
@Override
public String build() {
return "";
}
};
when(itemsBuilder.newClearItem(Mockito.<Command>any())).thenReturn(menuItem);
editorMenuSessionItems.populateMenu(fileMenuBuilder);
editorMenuSessionItems.setItemEnabled(ClearSessionCommand.class, true);
assertTrue(menuItem.isEnabled());
editorMenuSessionItems.setItemEnabled(ClearSessionCommand.class, false);
assertFalse(menuItem.isEnabled());
}
Aggregations