@Test public void testNewKBaseModelNonEmptyMap() { doReturn(singletonList(new KBaseModel())).when(knowledgeBaseListPresenter).getObjectsList(); final KBaseModel kBaseModel = knowledgeBasesPresenter.newKBaseModel("Name"); Assert.assertEquals("Name", kBaseModel.getName()); Assert.assertEquals(false, kBaseModel.isDefault()); }
KBaseModel newKBaseModel(final String knowledgeBaseName) { final KBaseModel kBaseModel = new KBaseModel(); kBaseModel.setName(knowledgeBaseName); kBaseModel.setDefault(knowledgeBaseListPresenter.getObjectsList().isEmpty()); return kBaseModel; }
KnowledgeBasesPresenter extends Section<ProjectScreenModel> { KBaseModel newKBaseModel(final String knowledgeBaseName) { final KBaseModel kBaseModel = new KBaseModel(); kBaseModel.setName(knowledgeBaseName); kBaseModel.setDefault(knowledgeBaseListPresenter.getObjectsList().isEmpty()); return kBaseModel; } }
KnowledgeBasesPresenter extends Section<ProjectScreenModel> { KBaseModel newKBaseModel(final String knowledgeBaseName) { final KBaseModel kBaseModel = new KBaseModel(); kBaseModel.setName(knowledgeBaseName); kBaseModel.setDefault(knowledgeBaseListPresenter.getObjectsList().isEmpty()); return kBaseModel; } @Inject  KnowledgeBasesPresenter(final View view,
                                   final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                   final Promises promises,
                                   final MenuItem<ProjectScreenModel> menuItem,
                                   final KnowledgeBaseListPresenter knowledgeBaseListPresenter); }
KnowledgeBasesPresenter extends Section<ProjectScreenModel> { KBaseModel newKBaseModel(final String knowledgeBaseName) { final KBaseModel kBaseModel = new KBaseModel(); kBaseModel.setName(knowledgeBaseName); kBaseModel.setDefault(knowledgeBaseListPresenter.getObjectsList().isEmpty()); return kBaseModel; } @Inject  KnowledgeBasesPresenter(final View view,
                                   final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                   final Promises promises,
                                   final MenuItem<ProjectScreenModel> menuItem,
                                   final KnowledgeBaseListPresenter knowledgeBaseListPresenter); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain); @Override SectionView<?> getView(); @Override int currentHashCode(); }
KnowledgeBasesPresenter extends Section<ProjectScreenModel> { KBaseModel newKBaseModel(final String knowledgeBaseName) { final KBaseModel kBaseModel = new KBaseModel(); kBaseModel.setName(knowledgeBaseName); kBaseModel.setDefault(knowledgeBaseListPresenter.getObjectsList().isEmpty()); return kBaseModel; } @Inject  KnowledgeBasesPresenter(final View view,
                                   final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                   final Promises promises,
                                   final MenuItem<ProjectScreenModel> menuItem,
                                   final KnowledgeBaseListPresenter knowledgeBaseListPresenter); @Override Promise<Void> setup(final ProjectScreenModel model); @Override Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain); @Override SectionView<?> getView(); @Override int currentHashCode();  }