@Test public void updateExecutableMenuItemAttributes() { LIElement toUpdateMock = mock(LIElement.class); NodeList<Element> elementsByTagNameMock = mock(NodeList.class); Element itemMock = mock(Element.class); when(elementsByTagNameMock.getItem(0)).thenReturn(itemMock); when(toUpdateMock.getElementsByTagName("span")).thenReturn(elementsByTagNameMock); String id = "TEST-ID"; String label = "TEST-LABEL"; String i18n = "TEST-i18n"; baseMenu.updateExecutableMenuItemAttributes(toUpdateMock, id, label, i18n); verify(toUpdateMock, times(1)).setId(eq(id)); verify(itemMock, times(1)).setInnerHTML(eq(label)); }
protected void updateExecutableMenuItemAttributes(LIElement toUpdate, String id, String label, String i18n) { toUpdate.setId(id); toUpdate.getElementsByTagName("span").getItem(0).setInnerHTML(label); }
BaseMenu implements IsWidget,
                                          BaseMenuView.BaseMenuPresenter { protected void updateExecutableMenuItemAttributes(LIElement toUpdate, String id, String label, String i18n) { toUpdate.setId(id); toUpdate.getElementsByTagName("span").getItem(0).setInnerHTML(label); } }
BaseMenu implements IsWidget,
                                          BaseMenuView.BaseMenuPresenter { protected void updateExecutableMenuItemAttributes(LIElement toUpdate, String id, String label, String i18n) { toUpdate.setId(id); toUpdate.getElementsByTagName("span").getItem(0).setInnerHTML(label); }  }
BaseMenu implements IsWidget,
                                          BaseMenuView.BaseMenuPresenter { protected void updateExecutableMenuItemAttributes(LIElement toUpdate, String id, String label, String i18n) { toUpdate.setId(id); toUpdate.getElementsByTagName("span").getItem(0).setInnerHTML(label); }  @PostConstruct @Override void initialise(); @Override LIElement addMenuItem(String id, String label, String i18n); @Override LIElement addExecutableMenuItem(String id, String label, String i18n, Event event); @Override LIElement addExecutableMenuItem(String id, String label, String i18n); @Override LIElement addExecutableMenuItemAfter(String id, String label, String i18n, LIElement previous); @Override void removeMenuItem(LIElement toRemove); @Override void mapEvent(LIElement executableMenuItem, Event toBeMapped); @Override Widget asWidget(); @Override void show(final int mx, final int my); @Override void hide(); @Override boolean isShown(); @Override BaseMenuView getView(); @Override void enableElement(Element element, boolean enabled); @Override boolean isDisabled(final Element element); @Override void onContextMenuEvent(ContextMenuEvent event); }
BaseMenu implements IsWidget,
                                          BaseMenuView.BaseMenuPresenter { protected void updateExecutableMenuItemAttributes(LIElement toUpdate, String id, String label, String i18n) { toUpdate.setId(id); toUpdate.getElementsByTagName("span").getItem(0).setInnerHTML(label); }  @PostConstruct @Override void initialise(); @Override LIElement addMenuItem(String id, String label, String i18n); @Override LIElement addExecutableMenuItem(String id, String label, String i18n, Event event); @Override LIElement addExecutableMenuItem(String id, String label, String i18n); @Override LIElement addExecutableMenuItemAfter(String id, String label, String i18n, LIElement previous); @Override void removeMenuItem(LIElement toRemove); @Override void mapEvent(LIElement executableMenuItem, Event toBeMapped); @Override Widget asWidget(); @Override void show(final int mx, final int my); @Override void hide(); @Override boolean isShown(); @Override BaseMenuView getView(); @Override void enableElement(Element element, boolean enabled); @Override boolean isDisabled(final Element element); @Override void onContextMenuEvent(ContextMenuEvent event);  }