@Test public void onlyLearningLanguagesAreUsed() { Language learningLanguage = Language.create("id", "name", 3, true, false); Language otherLanguage = Language.create("id2", "name2", 2, false, false); UserData data = prepareUserData(otherLanguage, learningLanguage, learningLanguage); when(accountModule.getUserData()).thenReturn(Optional.of(data)); presenter.onCreate(); presenter.onBind(view); verify(view).showUserData(any(), any(), eq(Arrays.asList(learningLanguage, learningLanguage))); }
@Override public void onCreate() { logger.debug("onCreate() called"); currentLanguage = accountModule.getUserData().get().getCurrentLearningLanguage(); applyState(IDrawerView::showListProgress); processUserData(accountModule.getUserData().get()); settingsModule.loadUserData().enqueue(this::processUserData, this::processUserDataError); }
DrawerPresenter extends AbstractPresenter<IDrawerView> { @Override public void onCreate() { logger.debug("onCreate() called"); currentLanguage = accountModule.getUserData().get().getCurrentLearningLanguage(); applyState(IDrawerView::showListProgress); processUserData(accountModule.getUserData().get()); settingsModule.loadUserData().enqueue(this::processUserData, this::processUserDataError); } }
DrawerPresenter extends AbstractPresenter<IDrawerView> { @Override public void onCreate() { logger.debug("onCreate() called"); currentLanguage = accountModule.getUserData().get().getCurrentLearningLanguage(); applyState(IDrawerView::showListProgress); processUserData(accountModule.getUserData().get()); settingsModule.loadUserData().enqueue(this::processUserData, this::processUserDataError); } @Inject  DrawerPresenter(MainPresenter mainPresenter, AccountModule accountModule, SettingsModule settingsModule,
                           @Named(VIEW_EXECUTOR) Executor executor); }
DrawerPresenter extends AbstractPresenter<IDrawerView> { @Override public void onCreate() { logger.debug("onCreate() called"); currentLanguage = accountModule.getUserData().get().getCurrentLearningLanguage(); applyState(IDrawerView::showListProgress); processUserData(accountModule.getUserData().get()); settingsModule.loadUserData().enqueue(this::processUserData, this::processUserDataError); } @Inject  DrawerPresenter(MainPresenter mainPresenter, AccountModule accountModule, SettingsModule settingsModule,
                           @Named(VIEW_EXECUTOR) Executor executor); @Override void onCreate(); @Override void onDestroy(); void onLanguageSelected(final Language language); }
DrawerPresenter extends AbstractPresenter<IDrawerView> { @Override public void onCreate() { logger.debug("onCreate() called"); currentLanguage = accountModule.getUserData().get().getCurrentLearningLanguage(); applyState(IDrawerView::showListProgress); processUserData(accountModule.getUserData().get()); settingsModule.loadUserData().enqueue(this::processUserData, this::processUserDataError); } @Inject  DrawerPresenter(MainPresenter mainPresenter, AccountModule accountModule, SettingsModule settingsModule,
                           @Named(VIEW_EXECUTOR) Executor executor); @Override void onCreate(); @Override void onDestroy(); void onLanguageSelected(final Language language);  }