@Test public void testPopulate() { final List<TreeListSubItem> subItems = new ArrayList<>(); final String itemDescription = "Item Description"; final TreeListItem item = mock(TreeListItem.class); when(item.getIsSelected()).thenReturn(true); when(item.getDescription()).thenReturn(itemDescription); when(item.getSubItems()).thenReturn(subItems); doNothing().when(itemView).setExpandVisibility(item); itemView.populate(item); assertTrue(checkbox.checked); assertEquals(itemDescription, itemDetails.textContent); verify(itemView).addSubItems(item); verify(itemView).setExpandVisibility(item); }
public void populate(final TreeListItem item) { checkbox.checked = item.getIsSelected(); itemDetails.textContent = item.getDescription(); addSubItems(item); setExpandVisibility(item); }
TreeListItemView implements TreeListItem.View { public void populate(final TreeListItem item) { checkbox.checked = item.getIsSelected(); itemDetails.textContent = item.getDescription(); addSubItems(item); setExpandVisibility(item); } }
TreeListItemView implements TreeListItem.View { public void populate(final TreeListItem item) { checkbox.checked = item.getIsSelected(); itemDetails.textContent = item.getDescription(); addSubItems(item); setExpandVisibility(item); } @Inject  TreeListItemView(final HTMLDivElement itemHeader,
                            final HTMLDivElement itemsContainer,
                            final HTMLDivElement itemDetails,
                            final HTMLDivElement expandContainer,
                            @Named("span") final HTMLElement expand,
                            final HTMLInputElement checkbox,
                            final HTMLDivElement itemRoot); }
TreeListItemView implements TreeListItem.View { public void populate(final TreeListItem item) { checkbox.checked = item.getIsSelected(); itemDetails.textContent = item.getDescription(); addSubItems(item); setExpandVisibility(item); } @Inject  TreeListItemView(final HTMLDivElement itemHeader,
                            final HTMLDivElement itemsContainer,
                            final HTMLDivElement itemDetails,
                            final HTMLDivElement expandContainer,
                            @Named("span") final HTMLElement expand,
                            final HTMLInputElement checkbox,
                            final HTMLDivElement itemRoot); TreeListItem getPresenter(); @Override void init(final TreeListItem presenter); @EventHandler("data-object-checkbox") void onCheckboxChanged(final ChangeEvent valueChanged); @EventHandler("item-header") void onClick(final ClickEvent e); void populate(final TreeListItem item); @Override HTMLElement getElement(); }
TreeListItemView implements TreeListItem.View { public void populate(final TreeListItem item) { checkbox.checked = item.getIsSelected(); itemDetails.textContent = item.getDescription(); addSubItems(item); setExpandVisibility(item); } @Inject  TreeListItemView(final HTMLDivElement itemHeader,
                            final HTMLDivElement itemsContainer,
                            final HTMLDivElement itemDetails,
                            final HTMLDivElement expandContainer,
                            @Named("span") final HTMLElement expand,
                            final HTMLInputElement checkbox,
                            final HTMLDivElement itemRoot); TreeListItem getPresenter(); @Override void init(final TreeListItem presenter); @EventHandler("data-object-checkbox") void onCheckboxChanged(final ChangeEvent valueChanged); @EventHandler("item-header") void onClick(final ClickEvent e); void populate(final TreeListItem item); @Override HTMLElement getElement();  }