@Test public void testOnDefaultKnowledgeSessionChanged() { final KBaseModel kBaseModel = new KBaseModel(); final KSessionModel kSessionModel = new KSessionModel(); kSessionModel.setDefault(true); final KnowledgeSessionsModal parentPresenter = mock(KnowledgeSessionsModal.class); doReturn(kBaseModel).when(parentPresenter).getObject(); knowledgeSessionListItemPresenter.parentPresenter = parentPresenter; knowledgeSessionListItemPresenter.kSessionModel = kSessionModel; knowledgeSessionListItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeSessionChange(kBaseModel, kSessionModel)); Assert.assertTrue(kSessionModel.isDefault()); }
public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeSessionChange event) { if (event.getKBaseModel().equals(parentPresenter.getObject()) && !event.getNewDefault().equals(kSessionModel)) { kSessionModel.setDefault(false); } }
KnowledgeSessionListItemPresenter extends ListItemPresenter<KSessionModel, KnowledgeSessionsModal, KnowledgeSessionListItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeSessionChange event) { if (event.getKBaseModel().equals(parentPresenter.getObject()) && !event.getNewDefault().equals(kSessionModel)) { kSessionModel.setDefault(false); } } }
KnowledgeSessionListItemPresenter extends ListItemPresenter<KSessionModel, KnowledgeSessionsModal, KnowledgeSessionListItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeSessionChange event) { if (event.getKBaseModel().equals(parentPresenter.getObject()) && !event.getNewDefault().equals(kSessionModel)) { kSessionModel.setDefault(false); } } @Inject  KnowledgeSessionListItemPresenter(final View view,
                                             final Event<DefaultKnowledgeSessionChange> defaultKnowledgeSessionChangeEvent,
                                             final WorkItemHandlersListPresenter workItemHandlersListPresenter,
                                             final ListenersListPresenter listenersListPresenter); }
KnowledgeSessionListItemPresenter extends ListItemPresenter<KSessionModel, KnowledgeSessionsModal, KnowledgeSessionListItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeSessionChange event) { if (event.getKBaseModel().equals(parentPresenter.getObject()) && !event.getNewDefault().equals(kSessionModel)) { kSessionModel.setDefault(false); } } @Inject  KnowledgeSessionListItemPresenter(final View view,
                                             final Event<DefaultKnowledgeSessionChange> defaultKnowledgeSessionChangeEvent,
                                             final WorkItemHandlersListPresenter workItemHandlersListPresenter,
                                             final ListenersListPresenter listenersListPresenter); @Override KnowledgeSessionListItemPresenter setup(final KSessionModel kSessionModel,
                                                   final KnowledgeSessionsModal parentPresenter); @Override void remove(); @Override KSessionModel getObject(); void setName(final String name); void setType(final String type); void addListener(); void addWorkItemHandler(); void fireChangeEvent(); void closeAllExpandableListItems(); void signalWorkItemHandlerAddedOrRemoved(); void signalListenerAddedOrRemoved(); void setDefault(final boolean isDefault); void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeSessionChange event); }
KnowledgeSessionListItemPresenter extends ListItemPresenter<KSessionModel, KnowledgeSessionsModal, KnowledgeSessionListItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeSessionChange event) { if (event.getKBaseModel().equals(parentPresenter.getObject()) && !event.getNewDefault().equals(kSessionModel)) { kSessionModel.setDefault(false); } } @Inject  KnowledgeSessionListItemPresenter(final View view,
                                             final Event<DefaultKnowledgeSessionChange> defaultKnowledgeSessionChangeEvent,
                                             final WorkItemHandlersListPresenter workItemHandlersListPresenter,
                                             final ListenersListPresenter listenersListPresenter); @Override KnowledgeSessionListItemPresenter setup(final KSessionModel kSessionModel,
                                                   final KnowledgeSessionsModal parentPresenter); @Override void remove(); @Override KSessionModel getObject(); void setName(final String name); void setType(final String type); void addListener(); void addWorkItemHandler(); void fireChangeEvent(); void closeAllExpandableListItems(); void signalWorkItemHandlerAddedOrRemoved(); void signalListenerAddedOrRemoved(); void setDefault(final boolean isDefault); void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeSessionChange event);  }