@Test public void setupTest() { final HomeShortcut shortcut = ModelUtils.makeShortcut("iconCss iconCss2", "heading", "subHeadingPrefix{0}subHeadingSuffix", mock(Command.class)); final HomeShortcutLink link = new HomeShortcutLink("label", "perspectiveIdentifier"); shortcut.addLink(link); presenter.setup(shortcut); verify(view).addIconClass("iconCss"); verify(view).addIconClass("iconCss2"); verify(view).setHeading(shortcut.getHeading()); verify(view).setAction(shortcut.getOnClickCommand()); verify(textPresenter).setup(shortcut.getSubHeading(), 1); verify(textPresenter).setup(shortcut.getSubHeading(), 2); verify(view, times(2)).addSubHeadingChild(textPresenter.getView()); verify(linkPresenter).setup(link); verify(view).addSubHeadingChild(linkPresenter.getView()); }
public void setup(final HomeShortcut shortcut) { setupIcon(shortcut); view.setHeading(shortcut.getHeading()); setupAction(shortcut); setupSubHeading(shortcut); }
ShortcutPresenter { public void setup(final HomeShortcut shortcut) { setupIcon(shortcut); view.setHeading(shortcut.getHeading()); setupAction(shortcut); setupSubHeading(shortcut); } }
ShortcutPresenter { public void setup(final HomeShortcut shortcut) { setupIcon(shortcut); view.setHeading(shortcut.getHeading()); setupAction(shortcut); setupSubHeading(shortcut); } @Inject  ShortcutPresenter(final View view,
                             final ShortcutHelper shortcutHelper,
                             final ManagedInstance<ShortcutSubHeadingLinkPresenter> linkPresenters,
                             final ManagedInstance<ShortcutSubHeadingTextPresenter> textPresenters); }
ShortcutPresenter { public void setup(final HomeShortcut shortcut) { setupIcon(shortcut); view.setHeading(shortcut.getHeading()); setupAction(shortcut); setupSubHeading(shortcut); } @Inject  ShortcutPresenter(final View view,
                             final ShortcutHelper shortcutHelper,
                             final ManagedInstance<ShortcutSubHeadingLinkPresenter> linkPresenters,
                             final ManagedInstance<ShortcutSubHeadingTextPresenter> textPresenters); @PostConstruct void init(); void setup(final HomeShortcut shortcut); View getView(); }
ShortcutPresenter { public void setup(final HomeShortcut shortcut) { setupIcon(shortcut); view.setHeading(shortcut.getHeading()); setupAction(shortcut); setupSubHeading(shortcut); } @Inject  ShortcutPresenter(final View view,
                             final ShortcutHelper shortcutHelper,
                             final ManagedInstance<ShortcutSubHeadingLinkPresenter> linkPresenters,
                             final ManagedInstance<ShortcutSubHeadingTextPresenter> textPresenters); @PostConstruct void init(); void setup(final HomeShortcut shortcut); View getView();  }