@Test public void setupTest() { presenter.setup(); verify(view).setWelcome("welcome"); verify(view).setDescription("description"); verify(view).setBackgroundImageUrl("backgroundImageUrl"); verify(view, times(3)).addShortcut(any()); }
public void setup() { profilePreferences.load(loadedProfilePreferences -> { modelProvider.initialize(()->{ final HomeModel model = modelProvider.get(loadedProfilePreferences); view.setWelcome(model.getWelcome()); view.setDescription(model.getDescription()); view.setBackgroundImageUrl(model.getBackgroundImageUrl()); model.getShortcuts().forEach(shortcut -> { final ShortcutPresenter shortcutPresenter = shortcutPresenters.get(); shortcutPresenter.setup(shortcut); view.addShortcut(shortcutPresenter); }); }); }, RuntimeException::new); }
HomePresenter { public void setup() { profilePreferences.load(loadedProfilePreferences -> { modelProvider.initialize(()->{ final HomeModel model = modelProvider.get(loadedProfilePreferences); view.setWelcome(model.getWelcome()); view.setDescription(model.getDescription()); view.setBackgroundImageUrl(model.getBackgroundImageUrl()); model.getShortcuts().forEach(shortcut -> { final ShortcutPresenter shortcutPresenter = shortcutPresenters.get(); shortcutPresenter.setup(shortcut); view.addShortcut(shortcutPresenter); }); }); }, RuntimeException::new); } }
HomePresenter { public void setup() { profilePreferences.load(loadedProfilePreferences -> { modelProvider.initialize(()->{ final HomeModel model = modelProvider.get(loadedProfilePreferences); view.setWelcome(model.getWelcome()); view.setDescription(model.getDescription()); view.setBackgroundImageUrl(model.getBackgroundImageUrl()); model.getShortcuts().forEach(shortcut -> { final ShortcutPresenter shortcutPresenter = shortcutPresenters.get(); shortcutPresenter.setup(shortcut); view.addShortcut(shortcutPresenter); }); }); }, RuntimeException::new); } @Inject  HomePresenter(final View view,
                         final TranslationService translationService,
                         final HomeModelProvider modelProvider,
                         final ManagedInstance<ShortcutPresenter> shortcutPresenters,
                         final ProfilePreferences profilePreferences); }
HomePresenter { public void setup() { profilePreferences.load(loadedProfilePreferences -> { modelProvider.initialize(()->{ final HomeModel model = modelProvider.get(loadedProfilePreferences); view.setWelcome(model.getWelcome()); view.setDescription(model.getDescription()); view.setBackgroundImageUrl(model.getBackgroundImageUrl()); model.getShortcuts().forEach(shortcut -> { final ShortcutPresenter shortcutPresenter = shortcutPresenters.get(); shortcutPresenter.setup(shortcut); view.addShortcut(shortcutPresenter); }); }); }, RuntimeException::new); } @Inject  HomePresenter(final View view,
                         final TranslationService translationService,
                         final HomeModelProvider modelProvider,
                         final ManagedInstance<ShortcutPresenter> shortcutPresenters,
                         final ProfilePreferences profilePreferences); void setup(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView UberElement<HomePresenter> getView(); }
HomePresenter { public void setup() { profilePreferences.load(loadedProfilePreferences -> { modelProvider.initialize(()->{ final HomeModel model = modelProvider.get(loadedProfilePreferences); view.setWelcome(model.getWelcome()); view.setDescription(model.getDescription()); view.setBackgroundImageUrl(model.getBackgroundImageUrl()); model.getShortcuts().forEach(shortcut -> { final ShortcutPresenter shortcutPresenter = shortcutPresenters.get(); shortcutPresenter.setup(shortcut); view.addShortcut(shortcutPresenter); }); }); }, RuntimeException::new); } @Inject  HomePresenter(final View view,
                         final TranslationService translationService,
                         final HomeModelProvider modelProvider,
                         final ManagedInstance<ShortcutPresenter> shortcutPresenters,
                         final ProfilePreferences profilePreferences); void setup(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView UberElement<HomePresenter> getView();  }